@nethesis/chat-island 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -8
- package/dist/ChatIsland.d.ts +1 -1
- package/dist/api.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/xmpp.d.ts +3 -3
- package/dist-widget/index.widget.css +1 -1
- package/dist-widget/index.widget.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,112 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NethVoice Chat Island
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A fully standalone chat component for NethVoice: one-to-one and group chats, attachments, voice notes, reactions, replies and notifications.
|
|
4
|
+
|
|
5
|
+
It runs in [NethVoice CTI](https://github.com/nethesis/nethvoice-cti), in [NethLink](https://github.com/NethServer/nethlink) and in any web page, and talks to the per-tenant XMPP server of [ns8-nethvoice](https://github.com/nethesis/ns8-nethvoice) with the user's CTI token.
|
|
6
|
+
|
|
7
|
+
**[Try the live demo](https://nethesis.github.io/chat-island/)**
|
|
8
|
+
|
|
9
|
+
## Builds
|
|
10
|
+
|
|
11
|
+
Available as component on `npm`
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@nethesis/chat-island)
|
|
14
|
+
|
|
15
|
+
Available as widget on `jsDelivr`
|
|
16
|
+
|
|
17
|
+
[](https://cdn.jsdelivr.net/npm/@nethesis/chat-island@latest/dist-widget/index.widget.js)
|
|
18
|
+
[](https://cdn.jsdelivr.net/npm/@nethesis/chat-island@latest/dist-widget/index.widget.css)
|
|
19
|
+
|
|
20
|
+
## Use it as a React component
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @nethesis/chat-island
|
|
24
|
+
```
|
|
4
25
|
|
|
5
26
|
```tsx
|
|
6
27
|
import { ChatIsland } from '@nethesis/chat-island'
|
|
7
28
|
import '@nethesis/chat-island/dist/index.css'
|
|
8
29
|
|
|
9
|
-
<ChatIsland dataConfig={btoa(`${ctiHost}:${username}:${
|
|
30
|
+
<ChatIsland dataConfig={btoa(`${ctiHost}:${username}:${ctiToken}`)} serviceWorker="/chat-island-sw.js" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Prop | Default | |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `dataConfig` | | Base64 of `<cti_host>:<cti_username>:<cti_token>` |
|
|
36
|
+
| `theme` | host's `dark` class | `light`, `dark` or `system` |
|
|
37
|
+
| `position` | `bottom-right` | or `bottom-left` |
|
|
38
|
+
| `serviceWorker` | | URL of `chat-island-sw.js` on the host: notifications with the tab closed |
|
|
39
|
+
| `notifications` | `click` | `auto` asks for permission once online |
|
|
40
|
+
| `newChatButton` | `true` | `false` when the host has its own list |
|
|
41
|
+
| `maxHeads` | `5` | chat heads kept in the dock |
|
|
42
|
+
| `sound` | `true` | chime for a message not in view |
|
|
43
|
+
| `drag` / `onDragStart` | `true` | off, or the host moves its own window (NethLink) |
|
|
44
|
+
|
|
45
|
+
`contactsFromOperators(operators, avatars, me)` turns the CTI operators into the contacts the island takes with `chat-island-contacts`.
|
|
46
|
+
|
|
47
|
+
## Integrate in any template
|
|
48
|
+
|
|
49
|
+
The widget works in any HTML page, CMS or server-rendered application, without React. You need:
|
|
50
|
+
|
|
51
|
+
1. the CDN CSS file;
|
|
52
|
+
2. the CDN JavaScript bundle;
|
|
53
|
+
3. an element with class `chat-island` and a Base64 config token in `data-config`;
|
|
54
|
+
4. optionally, a script of yours that sends commands and listens to the island's browser events.
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<!doctype html>
|
|
58
|
+
<html lang="en">
|
|
59
|
+
<head>
|
|
60
|
+
<meta charset="utf-8" />
|
|
61
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@nethesis/chat-island@latest/dist-widget/index.widget.css" />
|
|
62
|
+
</head>
|
|
63
|
+
<body>
|
|
64
|
+
<div class="chat-island" data-config="YOUR_BASE64_CONFIG_TOKEN" data-theme="system"></div>
|
|
65
|
+
|
|
66
|
+
<script src="https://cdn.jsdelivr.net/npm/@nethesis/chat-island@latest/dist-widget/index.widget.js"></script>
|
|
67
|
+
<script>
|
|
68
|
+
window.addEventListener('chat-island-unread', (e) => (document.title = `(${e.detail.total}) My page`))
|
|
69
|
+
// open the chat with an operator
|
|
70
|
+
window.dispatchEvent(new CustomEvent('chat-island-open', { detail: { username: 'mario' } }))
|
|
71
|
+
</script>
|
|
72
|
+
</body>
|
|
73
|
+
</html>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The widget mounts on the `.chat-island` elements present when its script runs. Attributes:
|
|
77
|
+
|
|
78
|
+
| Attribute | |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `data-config` | Base64 config token (required) |
|
|
81
|
+
| `data-theme` | `light`, `dark` or `system` |
|
|
82
|
+
| `data-position` | `bottom-right` or `bottom-left` |
|
|
83
|
+
| `data-service-worker` | URL of `chat-island-sw.js`, served by your site (same origin) |
|
|
84
|
+
| `data-notifications` | `auto` to ask for permission once online |
|
|
85
|
+
| `data-new-chat-button` | `false` to hide the new chat button |
|
|
86
|
+
|
|
87
|
+
### Base64 config token
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
<cti_host>:<cti_username>:<cti_token>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The CTI token comes from the NethVoice middleware login:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
TOKEN=$(curl -s -X POST https://cti.example.com/api/login \
|
|
97
|
+
-H 'Content-Type: application/json' -d '{"username":"mario","password":"..."}' | jq -r .token)
|
|
98
|
+
echo -n "cti.example.com:mario:$TOKEN" | base64 -w0
|
|
10
99
|
```
|
|
11
100
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
101
|
+
The chat must be on in NethVoice and the user's CTI profile must have the Chat permission. With two-factor authentication, use a token from a QR code login.
|
|
102
|
+
|
|
103
|
+
A complete example page is in `widget-example/`; the live demo is `index.html`.
|
|
15
104
|
|
|
16
105
|
## Events
|
|
17
106
|
|
|
18
107
|
| Event | Direction | Detail |
|
|
19
108
|
| --- | --- | --- |
|
|
20
|
-
| `chat-island-open` | in | `{ username }`
|
|
109
|
+
| `chat-island-open` | in | `{ username }` operator or group address |
|
|
21
110
|
| `chat-island-close` | in | |
|
|
22
111
|
| `chat-island-new` | in | open the new chat panel |
|
|
23
112
|
| `chat-island-delete` | in | `{ username }` purge a conversation, leave or destroy a group |
|
|
@@ -33,6 +122,16 @@ Serve `dist/chat-island-sw.js` from the host for notifications with the tab clos
|
|
|
33
122
|
| `chat-island-call` | out | `{ username, number }` |
|
|
34
123
|
| `chat-island-notify` | out | `{ peer, name, body, kind, author, text, attachment, avatar, ts }` message not in view |
|
|
35
124
|
|
|
125
|
+
## Live demo
|
|
126
|
+
|
|
127
|
+
`index.html` is published on [GitHub Pages](https://nethesis.github.io/chat-island/) by `.github/workflows/pages.yml` at every push to `main`, with the widget built from the same commit. It logs in with NethVoice credentials (or a token), mounts the widget and shows its events.
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
npm install
|
|
131
|
+
npm run build:widget
|
|
132
|
+
python3 -m http.server # then open http://localhost:8000/
|
|
133
|
+
```
|
|
134
|
+
|
|
36
135
|
## Develop
|
|
37
136
|
|
|
38
137
|
```sh
|
|
@@ -41,4 +140,4 @@ npm run dev
|
|
|
41
140
|
npm run build && npm run build:widget
|
|
42
141
|
```
|
|
43
142
|
|
|
44
|
-
A tag publishes the package to npm.
|
|
143
|
+
A tag publishes the package to npm; jsDelivr serves the widget from it.
|
package/dist/ChatIsland.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ChatIslandProps {
|
|
|
11
11
|
serviceWorker?: string;
|
|
12
12
|
/** How many chat heads the dock keeps; older ones drop off. Default 5. */
|
|
13
13
|
maxHeads?: number;
|
|
14
|
-
/** Show the "new chat" button with the
|
|
14
|
+
/** Show the "new chat" button with the operator picker. Off when the host has its own list. Default true. */
|
|
15
15
|
newChatButton?: boolean;
|
|
16
16
|
/** Notification permission: 'auto' asks once online, 'click' waits for the bell. Default 'click'. */
|
|
17
17
|
notifications?: 'auto' | 'click';
|
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Contact } from './types';
|
|
2
2
|
export declare function fetchContacts(host: string, token: string, me: string, onMe?: (name: string) => void): Promise<Contact[]>;
|
|
3
|
-
/**
|
|
3
|
+
/** Operators with the mobile app registered for push: a message reaches their phone even when they are not in the chat. */
|
|
4
4
|
export declare function fetchMobile(host: string, token: string): Promise<string[]>;
|
|
5
|
-
/** Forget a conversation on the server: my archive with that
|
|
5
|
+
/** Forget a conversation on the server: my archive with that operator or group is purged. */
|
|
6
6
|
export declare function deleteHistory(host: string, token: string, peer: string): Promise<void>;
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.chat-island-root,.chat-island-root *,.chat-island-root :before,.chat-island-root :after,.chat-island-root ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ci-fixed{position:fixed}.ci-absolute{position:absolute}.ci-relative{position:relative}.ci--left-1{left:-.25rem}.ci--right-1{right:-.25rem}.ci--right-1\.5{right:-.375rem}.ci--top-1{top:-.25rem}.ci-bottom-0{bottom:0}.ci-bottom-1{bottom:.25rem}.ci-bottom-2{bottom:.5rem}.ci-bottom-5{bottom:1.25rem}.ci-bottom-full{bottom:100%}.ci-left-0{left:0}.ci-left-1\/2{left:50%}.ci-left-2{left:.5rem}.ci-left-3{left:.75rem}.ci-left-4{left:1rem}.ci-right-0{right:0}.ci-right-3{right:.75rem}.ci-right-4{right:1rem}.ci-top-16{top:4rem}.ci-z-10{z-index:10}.ci-z-20{z-index:20}.ci-z-30{z-index:30}.ci-z-\[1\]{z-index:1}.ci-z-\[9999\]{z-index:9999}.ci-m-0{margin:0}.ci-mx-3{margin-left:.75rem;margin-right:.75rem}.ci-my-1{margin-top:.25rem;margin-bottom:.25rem}.ci--mt-1\.5{margin-top:-.375rem}.ci-mb-1{margin-bottom:.25rem}.ci-mb-1\.5{margin-bottom:.375rem}.ci-mb-3{margin-bottom:.75rem}.ci-mt-0\.5{margin-top:.125rem}.ci-mt-1{margin-top:.25rem}.ci-mt-2{margin-top:.5rem}.ci-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ci-block{display:block}.ci-flex{display:flex}.ci-grid{display:grid}.ci-hidden{display:none}.ci-h-10{height:2.5rem}.ci-h-12{height:3rem}.ci-h-2\.5{height:.625rem}.ci-h-3{height:.75rem}.ci-h-5{height:1.25rem}.ci-h-6{height:1.5rem}.ci-h-64{height:16rem}.ci-h-7{height:1.75rem}.ci-h-8{height:2rem}.ci-h-9{height:2.25rem}.ci-h-\[30rem\]{height:30rem}.ci-h-full{height:100%}.ci-max-h-32{max-height:8rem}.ci-max-h-60{max-height:15rem}.ci-max-h-64{max-height:16rem}.ci-max-h-\[30rem\]{max-height:30rem}.ci-min-h-0{min-height:0}.ci-w-0{width:0}.ci-w-10{width:2.5rem}.ci-w-12{width:3rem}.ci-w-2\.5{width:.625rem}.ci-w-3{width:.75rem}.ci-w-5{width:1.25rem}.ci-w-7{width:1.75rem}.ci-w-8{width:2rem}.ci-w-9{width:2.25rem}.ci-w-\[21rem\]{width:21rem}.ci-w-\[22rem\]{width:22rem}.ci-w-auto{width:auto}.ci-w-full{width:100%}.ci-min-w-0{min-width:0}.ci-min-w-5{min-width:1.25rem}.ci-max-w-\[80\%\]{max-width:80%}.ci-max-w-full{max-width:100%}.ci-flex-1{flex:1}.ci-shrink-0{flex-shrink:0}.ci--translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ci-pulse{50%{opacity:.5}}.ci-animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite ci-pulse}.ci-cursor-grab{cursor:grab}.ci-cursor-pointer{cursor:pointer}.ci-cursor-text{cursor:text}.ci-touch-none{touch-action:none}.ci-select-none{-webkit-user-select:none;user-select:none}.ci-select-text{-webkit-user-select:text;user-select:text}.ci-resize-none{resize:none}.ci-list-none{list-style-type:none}.ci-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.ci-flex-col{flex-direction:column}.ci-flex-col-reverse{flex-direction:column-reverse}.ci-flex-wrap{flex-wrap:wrap}.ci-content-center{align-content:center}.ci-items-start{align-items:flex-start}.ci-items-end{align-items:flex-end}.ci-items-center{align-items:center}.ci-justify-start{justify-content:flex-start}.ci-justify-end{justify-content:flex-end}.ci-justify-center{justify-content:center}.ci-gap-0\.5{gap:.125rem}.ci-gap-1{gap:.25rem}.ci-gap-1\.5{gap:.375rem}.ci-gap-2{gap:.5rem}.ci-gap-3{gap:.75rem}.ci-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.ci-self-center{align-self:center}.ci-overflow-hidden{overflow:hidden}.ci-overflow-x-auto{overflow-x:auto}.ci-overflow-y-auto{overflow-y:auto}.ci-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ci-whitespace-nowrap{white-space:nowrap}.ci-whitespace-pre{white-space:pre}.ci-whitespace-pre-wrap{white-space:pre-wrap}.ci-break-words{overflow-wrap:break-word}.ci-break-all{word-break:break-all}.ci-rounded{border-radius:.25rem}.ci-rounded-2xl{border-radius:1rem}.ci-rounded-3xl{border-radius:1.5rem}.ci-rounded-full{border-radius:9999px}.ci-rounded-lg{border-radius:.5rem}.ci-rounded-xl{border-radius:.75rem}.ci-rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}.ci-rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}.ci-rounded-bl-lg{border-bottom-left-radius:.5rem}.ci-rounded-br-lg{border-bottom-right-radius:.5rem}.ci-border{border-width:1px}.ci-border-0{border-width:0}.ci-border-b{border-bottom-width:1px}.ci-border-b-2{border-bottom-width:2px}.ci-border-l-4{border-left-width:4px}.ci-border-t{border-top-width:1px}.ci-border-solid{border-style:solid}.ci-border-emerald-400{--tw-border-opacity:1;border-color:rgb(52 211 153/var(--tw-border-opacity,1))}.ci-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.ci-border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.ci-border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.ci-border-iconSecondary{--tw-border-opacity:1;border-color:rgb(67 56 202/var(--tw-border-opacity,1))}.ci-border-transparent{border-color:#0000}.ci-bg-black\/10{background-color:#0000001a}.ci-bg-black\/20{background-color:#0003}.ci-bg-black\/5{background-color:#0000000d}.ci-bg-elevationL2{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.ci-bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.ci-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.ci-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.ci-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.ci-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-iconSecondary{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandActive{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandCall{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandClose{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.ci-bg-transparent{background-color:#0000}.ci-object-cover{-o-object-fit:cover;object-fit:cover}.ci-p-0{padding:0}.ci-p-1{padding:.25rem}.ci-p-2{padding:.5rem}.ci-px-1{padding-left:.25rem;padding-right:.25rem}.ci-px-1\.5{padding-left:.375rem;padding-right:.375rem}.ci-px-2{padding-left:.5rem;padding-right:.5rem}.ci-px-2\.5{padding-left:.625rem;padding-right:.625rem}.ci-px-3{padding-left:.75rem;padding-right:.75rem}.ci-px-3\.5{padding-left:.875rem;padding-right:.875rem}.ci-px-4{padding-left:1rem;padding-right:1rem}.ci-px-5{padding-left:1.25rem;padding-right:1.25rem}.ci-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.ci-py-1{padding-top:.25rem;padding-bottom:.25rem}.ci-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.ci-py-2{padding-top:.5rem;padding-bottom:.5rem}.ci-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.ci-py-3{padding-top:.75rem;padding-bottom:.75rem}.ci-py-6{padding-top:1.5rem;padding-bottom:1.5rem}.ci-pb-1\.5{padding-bottom:.375rem}.ci-pb-2{padding-bottom:.5rem}.ci-pl-11{padding-left:2.75rem}.ci-pl-2{padding-left:.5rem}.ci-pl-2\.5{padding-left:.625rem}.ci-pl-3{padding-left:.75rem}.ci-pr-1{padding-right:.25rem}.ci-pr-1\.5{padding-right:.375rem}.ci-pr-2{padding-right:.5rem}.ci-pr-4{padding-right:1rem}.ci-pt-2{padding-top:.5rem}.ci-text-left{text-align:left}.ci-text-center{text-align:center}.ci-text-right{text-align:right}.ci-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ci-font-sans{font-family:Poppins,Inter,system-ui,sans-serif}.ci-text-\[0\.85em\]{font-size:.85em}.ci-text-\[10px\]{font-size:10px}.ci-text-lg{font-size:1.125rem;line-height:1.75rem}.ci-text-sm{font-size:.875rem;line-height:1.25rem}.ci-text-xs{font-size:.75rem;line-height:1rem}.ci-font-light{font-weight:300}.ci-font-medium{font-weight:500}.ci-italic{font-style:italic}.ci-not-italic{font-style:normal}.ci-leading-4{line-height:1rem}.ci-leading-none{line-height:1}.ci-tracking-wide{letter-spacing:.025em}.ci-text-gray-50{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.ci-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.ci-text-inherit{color:inherit}.ci-text-primaryInvert{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-secondaryNeutral{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.ci-underline{text-decoration-line:underline}.ci-opacity-0{opacity:0}.ci-opacity-100{opacity:1}.ci-opacity-60{opacity:.6}.ci-opacity-80{opacity:.8}.ci-shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-xl{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-outline-none{outline-offset:2px;outline:2px solid #0000}.ci-ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-gray-300{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.ci-ring-gray-50{--tw-ring-opacity:1;--tw-ring-color:rgb(249 250 251/var(--tw-ring-opacity,1))}.ci-ring-iconSecondary{--tw-ring-opacity:1;--tw-ring-color:rgb(67 56 202/var(--tw-ring-opacity,1))}.ci-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-duration-200{transition-duration:.2s}.chat-island-root,.chat-island-root *{box-sizing:border-box}.chat-island-root{font-family:Poppins,Inter,system-ui,sans-serif;font-size:14px;line-height:1.4}.chat-island-root button{font:inherit;cursor:pointer}.chat-island-root textarea,.chat-island-root input{font:inherit}.chat-island-root ::-webkit-scrollbar{width:6px}.chat-island-root ::-webkit-scrollbar-thumb{background:#9ca3af80;border-radius:9999px}.placeholder\:ci-text-gray-500::placeholder{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.hover\:ci-scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-scale-125:hover{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300\/70:hover{background-color:#d1d5dbb3}.hover\:ci-bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCallHover:hover{--tw-bg-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCloseHover:hover{--tw-bg-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity,1))}.hover\:ci-opacity-100:hover{opacity:1}.focus\:ci-z-20:focus{z-index:20}.focus\:ci-opacity-100:focus{opacity:1}.focus\:ci-ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-emerald-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(16 185 129/var(--tw-ring-opacity,1))}.focus\:ci-ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity,1))}.focus\:ci-ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity,1))}.focus\:ci-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ci-ring-offset-white:focus{--tw-ring-offset-color:#fff}.active\:ci-cursor-grabbing:active{cursor:grabbing}.enabled\:hover\:ci-border-gray-500:hover:enabled{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity,1))}.enabled\:hover\:ci-bg-gray-300\/70:hover:enabled{background-color:#d1d5dbb3}.enabled\:hover\:ci-bg-gray-500:hover:enabled{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.disabled\:ci-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:ci-opacity-40:disabled{opacity:.4}.ci-group:focus-within .group-focus-within\:ci-flex,.ci-group:hover .group-hover\:ci-flex{display:flex}.ci-group:hover .group-hover\:ci-opacity-100{opacity:1}.dark\:ci-border-emerald-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(5 150 105/var(--tw-border-opacity,1))}.dark\:ci-border-gray-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}.dark\:ci-border-gray-700:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.dark\:ci-border-iconSecondaryDark:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.dark\:ci-bg-black\/10:is(.ci-dark *){background-color:#0000001a}.dark\:ci-bg-elevationL2Dark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-emerald-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(2 44 34/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-300:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-600:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-800:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-900:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(3 7 18/var(--tw-bg-opacity,1))}.dark\:ci-bg-iconSecondaryDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandActiveDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCallDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCloseDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.dark\:ci-bg-white\/10:is(.ci-dark *){background-color:#ffffff1a}.dark\:ci-text-gray-200:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-gray-400:is(.ci-dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:ci-text-gray-900:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-gray-950:is(.ci-dark *){--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity,1))}.dark\:ci-text-primaryInvertDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-secondaryNeutralDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-white:is(.ci-dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:ci-ring-gray-700:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity,1))}.dark\:ci-ring-gray-950:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(3 7 18/var(--tw-ring-opacity,1))}.dark\:ci-ring-iconSecondaryDark:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:hover\:ci-bg-gray-50:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-600:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-700\/30:hover:is(.ci-dark *){background-color:#3741514d}.dark\:hover\:ci-bg-gray-800:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCallHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCloseHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(252 165 165/var(--tw-bg-opacity,1))}.dark\:focus\:ci-ring-emerald-300:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(110 231 183/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-gray-500:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-offset-black:focus:is(.ci-dark *){--tw-ring-offset-color:#000}.dark\:enabled\:hover\:ci-bg-gray-700\/30:hover:enabled:is(.ci-dark *){background-color:#3741514d}
|
|
1
|
+
.chat-island-root,.chat-island-root *,.chat-island-root :before,.chat-island-root :after,.chat-island-root ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ci-fixed{position:fixed}.ci-absolute{position:absolute}.ci-relative{position:relative}.ci--left-1{left:-.25rem}.ci--right-1{right:-.25rem}.ci--right-1\.5{right:-.375rem}.ci--top-1{top:-.25rem}.ci-bottom-0{bottom:0}.ci-bottom-1{bottom:.25rem}.ci-bottom-2{bottom:.5rem}.ci-bottom-5{bottom:1.25rem}.ci-bottom-full{bottom:100%}.ci-left-0{left:0}.ci-left-1\/2{left:50%}.ci-left-2{left:.5rem}.ci-left-3{left:.75rem}.ci-left-4{left:1rem}.ci-right-0{right:0}.ci-right-3{right:.75rem}.ci-right-4{right:1rem}.ci-top-16{top:4rem}.ci-z-10{z-index:10}.ci-z-20{z-index:20}.ci-z-30{z-index:30}.ci-z-\[1\]{z-index:1}.ci-z-\[9999\]{z-index:9999}.ci-m-0{margin:0}.ci-mx-3{margin-left:.75rem;margin-right:.75rem}.ci-my-1{margin-top:.25rem;margin-bottom:.25rem}.ci--mt-1\.5{margin-top:-.375rem}.ci-mb-1{margin-bottom:.25rem}.ci-mb-1\.5{margin-bottom:.375rem}.ci-mb-3{margin-bottom:.75rem}.ci-mt-0\.5{margin-top:.125rem}.ci-mt-1{margin-top:.25rem}.ci-mt-2{margin-top:.5rem}.ci-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ci-block{display:block}.ci-flex{display:flex}.ci-grid{display:grid}.ci-hidden{display:none}.ci-h-10{height:2.5rem}.ci-h-12{height:3rem}.ci-h-2\.5{height:.625rem}.ci-h-3{height:.75rem}.ci-h-5{height:1.25rem}.ci-h-6{height:1.5rem}.ci-h-64{height:16rem}.ci-h-7{height:1.75rem}.ci-h-8{height:2rem}.ci-h-9{height:2.25rem}.ci-h-\[30rem\]{height:30rem}.ci-h-full{height:100%}.ci-max-h-32{max-height:8rem}.ci-max-h-60{max-height:15rem}.ci-max-h-64{max-height:16rem}.ci-max-h-\[30rem\]{max-height:30rem}.ci-min-h-0{min-height:0}.ci-w-0{width:0}.ci-w-10{width:2.5rem}.ci-w-12{width:3rem}.ci-w-2\.5{width:.625rem}.ci-w-3{width:.75rem}.ci-w-5{width:1.25rem}.ci-w-7{width:1.75rem}.ci-w-8{width:2rem}.ci-w-9{width:2.25rem}.ci-w-\[21rem\]{width:21rem}.ci-w-\[22rem\]{width:22rem}.ci-w-auto{width:auto}.ci-w-full{width:100%}.ci-min-w-0{min-width:0}.ci-min-w-5{min-width:1.25rem}.ci-max-w-\[80\%\]{max-width:80%}.ci-max-w-full{max-width:100%}.ci-flex-1{flex:1}.ci-shrink-0{flex-shrink:0}.ci--translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ci-pulse{50%{opacity:.5}}.ci-animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite ci-pulse}.ci-cursor-grab{cursor:grab}.ci-cursor-pointer{cursor:pointer}.ci-cursor-text{cursor:text}.ci-touch-none{touch-action:none}.ci-select-none{-webkit-user-select:none;user-select:none}.ci-select-text{-webkit-user-select:text;user-select:text}.ci-resize-none{resize:none}.ci-list-none{list-style-type:none}.ci-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.ci-flex-col{flex-direction:column}.ci-flex-col-reverse{flex-direction:column-reverse}.ci-flex-wrap{flex-wrap:wrap}.ci-content-center{align-content:center}.ci-items-start{align-items:flex-start}.ci-items-end{align-items:flex-end}.ci-items-center{align-items:center}.ci-justify-start{justify-content:flex-start}.ci-justify-end{justify-content:flex-end}.ci-justify-center{justify-content:center}.ci-gap-0\.5{gap:.125rem}.ci-gap-1{gap:.25rem}.ci-gap-1\.5{gap:.375rem}.ci-gap-2{gap:.5rem}.ci-gap-3{gap:.75rem}.ci-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.ci-self-center{align-self:center}.ci-overflow-hidden{overflow:hidden}.ci-overflow-x-auto{overflow-x:auto}.ci-overflow-y-auto{overflow-y:auto}.ci-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ci-whitespace-nowrap{white-space:nowrap}.ci-whitespace-pre{white-space:pre}.ci-whitespace-pre-wrap{white-space:pre-wrap}.ci-break-words{overflow-wrap:break-word}.ci-break-all{word-break:break-all}.ci-rounded{border-radius:.25rem}.ci-rounded-2xl{border-radius:1rem}.ci-rounded-3xl{border-radius:1.5rem}.ci-rounded-full{border-radius:9999px}.ci-rounded-lg{border-radius:.5rem}.ci-rounded-xl{border-radius:.75rem}.ci-rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}.ci-rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}.ci-rounded-bl-lg{border-bottom-left-radius:.5rem}.ci-rounded-br-lg{border-bottom-right-radius:.5rem}.ci-border{border-width:1px}.ci-border-0{border-width:0}.ci-border-b{border-bottom-width:1px}.ci-border-b-2{border-bottom-width:2px}.ci-border-l-4{border-left-width:4px}.ci-border-t{border-top-width:1px}.ci-border-solid{border-style:solid}.ci-border-emerald-400{--tw-border-opacity:1;border-color:rgb(52 211 153/var(--tw-border-opacity,1))}.ci-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.ci-border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.ci-border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.ci-border-iconSecondary{--tw-border-opacity:1;border-color:rgb(67 56 202/var(--tw-border-opacity,1))}.ci-border-transparent{border-color:#0000}.ci-bg-black\/10{background-color:#0000001a}.ci-bg-black\/20{background-color:#0003}.ci-bg-black\/5{background-color:#0000000d}.ci-bg-elevationL2{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.ci-bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.ci-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.ci-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.ci-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.ci-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-iconSecondary{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandActive{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandCall{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandClose{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.ci-bg-transparent{background-color:#0000}.ci-object-cover{-o-object-fit:cover;object-fit:cover}.ci-p-0{padding:0}.ci-p-1{padding:.25rem}.ci-p-2{padding:.5rem}.ci-px-1{padding-left:.25rem;padding-right:.25rem}.ci-px-1\.5{padding-left:.375rem;padding-right:.375rem}.ci-px-2{padding-left:.5rem;padding-right:.5rem}.ci-px-2\.5{padding-left:.625rem;padding-right:.625rem}.ci-px-3{padding-left:.75rem;padding-right:.75rem}.ci-px-3\.5{padding-left:.875rem;padding-right:.875rem}.ci-px-4{padding-left:1rem;padding-right:1rem}.ci-px-5{padding-left:1.25rem;padding-right:1.25rem}.ci-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.ci-py-1{padding-top:.25rem;padding-bottom:.25rem}.ci-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.ci-py-2{padding-top:.5rem;padding-bottom:.5rem}.ci-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.ci-py-3{padding-top:.75rem;padding-bottom:.75rem}.ci-py-6{padding-top:1.5rem;padding-bottom:1.5rem}.ci-pb-1\.5{padding-bottom:.375rem}.ci-pb-2{padding-bottom:.5rem}.ci-pl-11{padding-left:2.75rem}.ci-pl-2{padding-left:.5rem}.ci-pl-2\.5{padding-left:.625rem}.ci-pl-3{padding-left:.75rem}.ci-pr-1{padding-right:.25rem}.ci-pr-1\.5{padding-right:.375rem}.ci-pr-2{padding-right:.5rem}.ci-pr-4{padding-right:1rem}.ci-pt-2{padding-top:.5rem}.ci-text-left{text-align:left}.ci-text-center{text-align:center}.ci-text-right{text-align:right}.ci-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ci-font-sans{font-family:Poppins,Inter,system-ui,sans-serif}.ci-text-\[0\.85em\]{font-size:.85em}.ci-text-\[10px\]{font-size:10px}.ci-text-lg{font-size:1.125rem;line-height:1.75rem}.ci-text-sm{font-size:.875rem;line-height:1.25rem}.ci-text-xs{font-size:.75rem;line-height:1rem}.ci-font-light{font-weight:300}.ci-font-medium{font-weight:500}.ci-italic{font-style:italic}.ci-not-italic{font-style:normal}.ci-leading-4{line-height:1rem}.ci-leading-none{line-height:1}.ci-tracking-wide{letter-spacing:.025em}.ci-text-gray-50{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.ci-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.ci-text-inherit{color:inherit}.ci-text-primaryInvert{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-secondaryNeutral{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.ci-underline{text-decoration-line:underline}.ci-opacity-0{opacity:0}.ci-opacity-100{opacity:1}.ci-opacity-60{opacity:.6}.ci-opacity-80{opacity:.8}.ci-shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-xl{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-outline-none{outline-offset:2px;outline:2px solid #0000}.ci-ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-gray-300{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.ci-ring-gray-50{--tw-ring-opacity:1;--tw-ring-color:rgb(249 250 251/var(--tw-ring-opacity,1))}.ci-ring-iconSecondary{--tw-ring-opacity:1;--tw-ring-color:rgb(67 56 202/var(--tw-ring-opacity,1))}.ci-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-duration-200{transition-duration:.2s}.chat-island-root,.chat-island-root *{box-sizing:border-box}.chat-island-root{font-family:Poppins,Inter,system-ui,sans-serif;font-size:14px;line-height:1.4}:where(.chat-island-root) button:not(z),:where(.chat-island-root) input:not(z),:where(.chat-island-root) textarea:not(z){box-shadow:none;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-transform:none;outline-offset:0;background:0 0;border:0 solid #0000;border-radius:0;width:auto;min-width:0;max-width:none;height:auto;min-height:0;margin:0;padding:0}:where(.chat-island-root) button:not(z){cursor:pointer}:where(.chat-island-root),:where(.chat-island-root) :not(z),:where(.chat-island-root) :before,:where(.chat-island-root) :after{border:0 solid #e5e7eb}:where(.chat-island-root) :is(h1,h2,h3,h4,h5,h6,p,blockquote,figure,pre,ol,ul):not(z){margin:0}:where(.chat-island-root) :is(ol,ul):not(z){padding:0;list-style:none}:where(.chat-island-root) :is(img,svg,video,audio,canvas):not(z){vertical-align:middle;display:block}:where(.chat-island-root) :is(img,video):not(z){max-width:100%;height:auto}.chat-island-root ::-webkit-scrollbar{width:6px}.chat-island-root ::-webkit-scrollbar-thumb{background:#9ca3af80;border-radius:9999px}.placeholder\:ci-text-gray-500::placeholder{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.hover\:ci-scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-scale-125:hover{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300\/70:hover{background-color:#d1d5dbb3}.hover\:ci-bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCallHover:hover{--tw-bg-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCloseHover:hover{--tw-bg-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity,1))}.hover\:ci-opacity-100:hover{opacity:1}.focus\:ci-z-20:focus{z-index:20}.focus\:ci-opacity-100:focus{opacity:1}.focus\:ci-ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-emerald-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(16 185 129/var(--tw-ring-opacity,1))}.focus\:ci-ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity,1))}.focus\:ci-ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity,1))}.focus\:ci-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ci-ring-offset-white:focus{--tw-ring-offset-color:#fff}.active\:ci-cursor-grabbing:active{cursor:grabbing}.enabled\:hover\:ci-border-gray-500:hover:enabled{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity,1))}.enabled\:hover\:ci-bg-gray-300\/70:hover:enabled{background-color:#d1d5dbb3}.enabled\:hover\:ci-bg-gray-500:hover:enabled{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.disabled\:ci-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:ci-opacity-40:disabled{opacity:.4}.ci-group:focus-within .group-focus-within\:ci-flex,.ci-group:hover .group-hover\:ci-flex{display:flex}.ci-group:hover .group-hover\:ci-opacity-100{opacity:1}.dark\:ci-border-emerald-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(5 150 105/var(--tw-border-opacity,1))}.dark\:ci-border-gray-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}.dark\:ci-border-gray-700:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.dark\:ci-border-iconSecondaryDark:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.dark\:ci-bg-black\/10:is(.ci-dark *){background-color:#0000001a}.dark\:ci-bg-elevationL2Dark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-emerald-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(2 44 34/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-300:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-600:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-800:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-900:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(3 7 18/var(--tw-bg-opacity,1))}.dark\:ci-bg-iconSecondaryDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandActiveDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCallDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCloseDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.dark\:ci-bg-white\/10:is(.ci-dark *){background-color:#ffffff1a}.dark\:ci-text-gray-200:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-gray-400:is(.ci-dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:ci-text-gray-900:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-gray-950:is(.ci-dark *){--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity,1))}.dark\:ci-text-primaryInvertDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-secondaryNeutralDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-white:is(.ci-dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:ci-ring-gray-700:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity,1))}.dark\:ci-ring-gray-950:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(3 7 18/var(--tw-ring-opacity,1))}.dark\:ci-ring-iconSecondaryDark:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:hover\:ci-bg-gray-50:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-600:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-700\/30:hover:is(.ci-dark *){background-color:#3741514d}.dark\:hover\:ci-bg-gray-800:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCallHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCloseHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(252 165 165/var(--tw-bg-opacity,1))}.dark\:focus\:ci-ring-emerald-300:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(110 231 183/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-gray-500:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-offset-black:focus:is(.ci-dark *){--tw-ring-offset-color:#000}.dark\:enabled\:hover\:ci-bg-gray-700\/30:hover:enabled:is(.ci-dark *){background-color:#3741514d}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/index.js
CHANGED
|
@@ -4617,7 +4617,7 @@ function Lr({ onOpen: e, onCreateGroup: t }) {
|
|
|
4617
4617
|
autoFocus: !0,
|
|
4618
4618
|
value: l,
|
|
4619
4619
|
onChange: (e) => p(e.target.value),
|
|
4620
|
-
placeholder: "Search
|
|
4620
|
+
placeholder: "Search operators",
|
|
4621
4621
|
className: "ci-flex-1 ci-bg-transparent ci-border-0 ci-outline-none ci-text-sm ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400"
|
|
4622
4622
|
})]
|
|
4623
4623
|
}), /* @__PURE__ */ d(Z, {
|
|
@@ -4641,7 +4641,7 @@ function Lr({ onOpen: e, onCreateGroup: t }) {
|
|
|
4641
4641
|
className: "ci-overflow-y-auto ci-py-1 ci-m-0 ci-p-0 ci-list-none ci-flex-1",
|
|
4642
4642
|
children: [C.length === 0 && /* @__PURE__ */ d("li", {
|
|
4643
4643
|
className: "ci-px-4 ci-py-6 ci-text-center ci-text-sm ci-text-gray-500 dark:ci-text-gray-400",
|
|
4644
|
-
children: "No
|
|
4644
|
+
children: "No operators found"
|
|
4645
4645
|
}), C.map((e) => {
|
|
4646
4646
|
let t = m.includes(e.username);
|
|
4647
4647
|
return /* @__PURE__ */ d("li", { children: /* @__PURE__ */ f("button", {
|
package/dist/types.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface Config {
|
|
|
53
53
|
username: string;
|
|
54
54
|
token: string;
|
|
55
55
|
}
|
|
56
|
-
/** What the host app gets for its conversation list: one row per
|
|
56
|
+
/** What the host app gets for its conversation list: one row per operator or group. */
|
|
57
57
|
export interface ConversationSummary {
|
|
58
58
|
peer: string;
|
|
59
59
|
kind: 'chat' | 'group';
|
package/dist/xmpp.d.ts
CHANGED
|
@@ -54,11 +54,11 @@ export declare class Chat {
|
|
|
54
54
|
/** 1s, 2s, 4s… up to a minute, with jitter; one timer at a time. */
|
|
55
55
|
private scheduleRetry;
|
|
56
56
|
isGroup(peer: string): boolean;
|
|
57
|
-
/** Send to
|
|
57
|
+
/** Send to an operator (username) or to a group (room address); a reply quotes its target in the body too, for other clients. */
|
|
58
58
|
send(peer: string, body: string, oob?: string, reply?: Reply): Promise<Message>;
|
|
59
59
|
/** XEP-0444: my whole set of reactions to one message; an empty set takes them back. Archived like a message. */
|
|
60
60
|
react(peer: string, target: string, emojis: string[]): Promise<void>;
|
|
61
|
-
/** Tell these
|
|
61
|
+
/** Tell these operators I am here (directed presence). Those online answer, so both sides see each other. */
|
|
62
62
|
announce(peers: string[]): Promise<void>;
|
|
63
63
|
typing(peer: string, composing: boolean): Promise<void>;
|
|
64
64
|
/** XEP-0357: ask the server to notify `service` on node `node` when I am offline. */
|
|
@@ -67,7 +67,7 @@ export declare class Chat {
|
|
|
67
67
|
disablePush(service: string, node: string): Promise<Element>;
|
|
68
68
|
/** The newest `max` archived messages with anyone: what the conversation list is built from. */
|
|
69
69
|
recent(max?: number): Promise<HistoryPage>;
|
|
70
|
-
/** History with one
|
|
70
|
+
/** History with one operator or group, newest page first; pass `before` (archive id) to page back. */
|
|
71
71
|
history(peer: string, before?: string, max?: number): Promise<HistoryPage>;
|
|
72
72
|
private mam;
|
|
73
73
|
/** Create a group: a persistent members-only room, everyone subscribed, nobody joined. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.chat-island-root,.chat-island-root *,.chat-island-root :before,.chat-island-root :after,.chat-island-root ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ci-fixed{position:fixed}.ci-absolute{position:absolute}.ci-relative{position:relative}.ci--left-1{left:-.25rem}.ci--right-1{right:-.25rem}.ci--right-1\.5{right:-.375rem}.ci--top-1{top:-.25rem}.ci-bottom-0{bottom:0}.ci-bottom-1{bottom:.25rem}.ci-bottom-2{bottom:.5rem}.ci-bottom-5{bottom:1.25rem}.ci-bottom-full{bottom:100%}.ci-left-0{left:0}.ci-left-1\/2{left:50%}.ci-left-2{left:.5rem}.ci-left-3{left:.75rem}.ci-left-4{left:1rem}.ci-right-0{right:0}.ci-right-3{right:.75rem}.ci-right-4{right:1rem}.ci-top-16{top:4rem}.ci-z-10{z-index:10}.ci-z-20{z-index:20}.ci-z-30{z-index:30}.ci-z-\[1\]{z-index:1}.ci-z-\[9999\]{z-index:9999}.ci-m-0{margin:0}.ci-mx-3{margin-left:.75rem;margin-right:.75rem}.ci-my-1{margin-top:.25rem;margin-bottom:.25rem}.ci--mt-1\.5{margin-top:-.375rem}.ci-mb-1{margin-bottom:.25rem}.ci-mb-1\.5{margin-bottom:.375rem}.ci-mb-3{margin-bottom:.75rem}.ci-mt-0\.5{margin-top:.125rem}.ci-mt-1{margin-top:.25rem}.ci-mt-2{margin-top:.5rem}.ci-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ci-block{display:block}.ci-flex{display:flex}.ci-grid{display:grid}.ci-hidden{display:none}.ci-h-10{height:2.5rem}.ci-h-12{height:3rem}.ci-h-2\.5{height:.625rem}.ci-h-3{height:.75rem}.ci-h-5{height:1.25rem}.ci-h-6{height:1.5rem}.ci-h-64{height:16rem}.ci-h-7{height:1.75rem}.ci-h-8{height:2rem}.ci-h-9{height:2.25rem}.ci-h-\[30rem\]{height:30rem}.ci-h-full{height:100%}.ci-max-h-32{max-height:8rem}.ci-max-h-60{max-height:15rem}.ci-max-h-64{max-height:16rem}.ci-max-h-\[30rem\]{max-height:30rem}.ci-min-h-0{min-height:0}.ci-w-0{width:0}.ci-w-10{width:2.5rem}.ci-w-12{width:3rem}.ci-w-2\.5{width:.625rem}.ci-w-3{width:.75rem}.ci-w-5{width:1.25rem}.ci-w-7{width:1.75rem}.ci-w-8{width:2rem}.ci-w-9{width:2.25rem}.ci-w-\[21rem\]{width:21rem}.ci-w-\[22rem\]{width:22rem}.ci-w-auto{width:auto}.ci-w-full{width:100%}.ci-min-w-0{min-width:0}.ci-min-w-5{min-width:1.25rem}.ci-max-w-\[80\%\]{max-width:80%}.ci-max-w-full{max-width:100%}.ci-flex-1{flex:1}.ci-shrink-0{flex-shrink:0}.ci--translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ci-pulse{50%{opacity:.5}}.ci-animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite ci-pulse}.ci-cursor-grab{cursor:grab}.ci-cursor-pointer{cursor:pointer}.ci-cursor-text{cursor:text}.ci-touch-none{touch-action:none}.ci-select-none{-webkit-user-select:none;user-select:none}.ci-select-text{-webkit-user-select:text;user-select:text}.ci-resize-none{resize:none}.ci-list-none{list-style-type:none}.ci-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.ci-flex-col{flex-direction:column}.ci-flex-col-reverse{flex-direction:column-reverse}.ci-flex-wrap{flex-wrap:wrap}.ci-content-center{align-content:center}.ci-items-start{align-items:flex-start}.ci-items-end{align-items:flex-end}.ci-items-center{align-items:center}.ci-justify-start{justify-content:flex-start}.ci-justify-end{justify-content:flex-end}.ci-justify-center{justify-content:center}.ci-gap-0\.5{gap:.125rem}.ci-gap-1{gap:.25rem}.ci-gap-1\.5{gap:.375rem}.ci-gap-2{gap:.5rem}.ci-gap-3{gap:.75rem}.ci-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.ci-self-center{align-self:center}.ci-overflow-hidden{overflow:hidden}.ci-overflow-x-auto{overflow-x:auto}.ci-overflow-y-auto{overflow-y:auto}.ci-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ci-whitespace-nowrap{white-space:nowrap}.ci-whitespace-pre{white-space:pre}.ci-whitespace-pre-wrap{white-space:pre-wrap}.ci-break-words{overflow-wrap:break-word}.ci-break-all{word-break:break-all}.ci-rounded{border-radius:.25rem}.ci-rounded-2xl{border-radius:1rem}.ci-rounded-3xl{border-radius:1.5rem}.ci-rounded-full{border-radius:9999px}.ci-rounded-lg{border-radius:.5rem}.ci-rounded-xl{border-radius:.75rem}.ci-rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}.ci-rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}.ci-rounded-bl-lg{border-bottom-left-radius:.5rem}.ci-rounded-br-lg{border-bottom-right-radius:.5rem}.ci-border{border-width:1px}.ci-border-0{border-width:0}.ci-border-b{border-bottom-width:1px}.ci-border-b-2{border-bottom-width:2px}.ci-border-l-4{border-left-width:4px}.ci-border-t{border-top-width:1px}.ci-border-solid{border-style:solid}.ci-border-emerald-400{--tw-border-opacity:1;border-color:rgb(52 211 153/var(--tw-border-opacity,1))}.ci-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.ci-border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.ci-border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.ci-border-iconSecondary{--tw-border-opacity:1;border-color:rgb(67 56 202/var(--tw-border-opacity,1))}.ci-border-transparent{border-color:#0000}.ci-bg-black\/10{background-color:#0000001a}.ci-bg-black\/20{background-color:#0003}.ci-bg-black\/5{background-color:#0000000d}.ci-bg-elevationL2{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.ci-bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.ci-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.ci-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.ci-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.ci-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-iconSecondary{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandActive{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandCall{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandClose{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.ci-bg-transparent{background-color:#0000}.ci-object-cover{-o-object-fit:cover;object-fit:cover}.ci-p-0{padding:0}.ci-p-1{padding:.25rem}.ci-p-2{padding:.5rem}.ci-px-1{padding-left:.25rem;padding-right:.25rem}.ci-px-1\.5{padding-left:.375rem;padding-right:.375rem}.ci-px-2{padding-left:.5rem;padding-right:.5rem}.ci-px-2\.5{padding-left:.625rem;padding-right:.625rem}.ci-px-3{padding-left:.75rem;padding-right:.75rem}.ci-px-3\.5{padding-left:.875rem;padding-right:.875rem}.ci-px-4{padding-left:1rem;padding-right:1rem}.ci-px-5{padding-left:1.25rem;padding-right:1.25rem}.ci-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.ci-py-1{padding-top:.25rem;padding-bottom:.25rem}.ci-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.ci-py-2{padding-top:.5rem;padding-bottom:.5rem}.ci-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.ci-py-3{padding-top:.75rem;padding-bottom:.75rem}.ci-py-6{padding-top:1.5rem;padding-bottom:1.5rem}.ci-pb-1\.5{padding-bottom:.375rem}.ci-pb-2{padding-bottom:.5rem}.ci-pl-11{padding-left:2.75rem}.ci-pl-2{padding-left:.5rem}.ci-pl-2\.5{padding-left:.625rem}.ci-pl-3{padding-left:.75rem}.ci-pr-1{padding-right:.25rem}.ci-pr-1\.5{padding-right:.375rem}.ci-pr-2{padding-right:.5rem}.ci-pr-4{padding-right:1rem}.ci-pt-2{padding-top:.5rem}.ci-text-left{text-align:left}.ci-text-center{text-align:center}.ci-text-right{text-align:right}.ci-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ci-font-sans{font-family:Poppins,Inter,system-ui,sans-serif}.ci-text-\[0\.85em\]{font-size:.85em}.ci-text-\[10px\]{font-size:10px}.ci-text-lg{font-size:1.125rem;line-height:1.75rem}.ci-text-sm{font-size:.875rem;line-height:1.25rem}.ci-text-xs{font-size:.75rem;line-height:1rem}.ci-font-light{font-weight:300}.ci-font-medium{font-weight:500}.ci-italic{font-style:italic}.ci-not-italic{font-style:normal}.ci-leading-4{line-height:1rem}.ci-leading-none{line-height:1}.ci-tracking-wide{letter-spacing:.025em}.ci-text-gray-50{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.ci-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.ci-text-inherit{color:inherit}.ci-text-primaryInvert{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-secondaryNeutral{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.ci-underline{text-decoration-line:underline}.ci-opacity-0{opacity:0}.ci-opacity-100{opacity:1}.ci-opacity-60{opacity:.6}.ci-opacity-80{opacity:.8}.ci-shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-xl{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-outline-none{outline-offset:2px;outline:2px solid #0000}.ci-ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-gray-300{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.ci-ring-gray-50{--tw-ring-opacity:1;--tw-ring-color:rgb(249 250 251/var(--tw-ring-opacity,1))}.ci-ring-iconSecondary{--tw-ring-opacity:1;--tw-ring-color:rgb(67 56 202/var(--tw-ring-opacity,1))}.ci-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-duration-200{transition-duration:.2s}.chat-island-root,.chat-island-root *{box-sizing:border-box}.chat-island-root{font-family:Poppins,Inter,system-ui,sans-serif;font-size:14px;line-height:1.4}.chat-island-root button{font:inherit;cursor:pointer}.chat-island-root textarea,.chat-island-root input{font:inherit}.chat-island-root ::-webkit-scrollbar{width:6px}.chat-island-root ::-webkit-scrollbar-thumb{background:#9ca3af80;border-radius:9999px}.placeholder\:ci-text-gray-500::placeholder{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.hover\:ci-scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-scale-125:hover{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300\/70:hover{background-color:#d1d5dbb3}.hover\:ci-bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCallHover:hover{--tw-bg-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCloseHover:hover{--tw-bg-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity,1))}.hover\:ci-opacity-100:hover{opacity:1}.focus\:ci-z-20:focus{z-index:20}.focus\:ci-opacity-100:focus{opacity:1}.focus\:ci-ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-emerald-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(16 185 129/var(--tw-ring-opacity,1))}.focus\:ci-ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity,1))}.focus\:ci-ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity,1))}.focus\:ci-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ci-ring-offset-white:focus{--tw-ring-offset-color:#fff}.active\:ci-cursor-grabbing:active{cursor:grabbing}.enabled\:hover\:ci-border-gray-500:hover:enabled{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity,1))}.enabled\:hover\:ci-bg-gray-300\/70:hover:enabled{background-color:#d1d5dbb3}.enabled\:hover\:ci-bg-gray-500:hover:enabled{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.disabled\:ci-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:ci-opacity-40:disabled{opacity:.4}.ci-group:focus-within .group-focus-within\:ci-flex,.ci-group:hover .group-hover\:ci-flex{display:flex}.ci-group:hover .group-hover\:ci-opacity-100{opacity:1}.dark\:ci-border-emerald-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(5 150 105/var(--tw-border-opacity,1))}.dark\:ci-border-gray-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}.dark\:ci-border-gray-700:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.dark\:ci-border-iconSecondaryDark:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.dark\:ci-bg-black\/10:is(.ci-dark *){background-color:#0000001a}.dark\:ci-bg-elevationL2Dark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-emerald-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(2 44 34/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-300:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-600:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-800:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-900:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(3 7 18/var(--tw-bg-opacity,1))}.dark\:ci-bg-iconSecondaryDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandActiveDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCallDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCloseDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.dark\:ci-bg-white\/10:is(.ci-dark *){background-color:#ffffff1a}.dark\:ci-text-gray-200:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-gray-400:is(.ci-dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:ci-text-gray-900:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-gray-950:is(.ci-dark *){--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity,1))}.dark\:ci-text-primaryInvertDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-secondaryNeutralDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-white:is(.ci-dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:ci-ring-gray-700:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity,1))}.dark\:ci-ring-gray-950:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(3 7 18/var(--tw-ring-opacity,1))}.dark\:ci-ring-iconSecondaryDark:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:hover\:ci-bg-gray-50:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-600:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-700\/30:hover:is(.ci-dark *){background-color:#3741514d}.dark\:hover\:ci-bg-gray-800:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCallHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCloseHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(252 165 165/var(--tw-bg-opacity,1))}.dark\:focus\:ci-ring-emerald-300:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(110 231 183/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-gray-500:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-offset-black:focus:is(.ci-dark *){--tw-ring-offset-color:#000}.dark\:enabled\:hover\:ci-bg-gray-700\/30:hover:enabled:is(.ci-dark *){background-color:#3741514d}
|
|
1
|
+
.chat-island-root,.chat-island-root *,.chat-island-root :before,.chat-island-root :after,.chat-island-root ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ci-fixed{position:fixed}.ci-absolute{position:absolute}.ci-relative{position:relative}.ci--left-1{left:-.25rem}.ci--right-1{right:-.25rem}.ci--right-1\.5{right:-.375rem}.ci--top-1{top:-.25rem}.ci-bottom-0{bottom:0}.ci-bottom-1{bottom:.25rem}.ci-bottom-2{bottom:.5rem}.ci-bottom-5{bottom:1.25rem}.ci-bottom-full{bottom:100%}.ci-left-0{left:0}.ci-left-1\/2{left:50%}.ci-left-2{left:.5rem}.ci-left-3{left:.75rem}.ci-left-4{left:1rem}.ci-right-0{right:0}.ci-right-3{right:.75rem}.ci-right-4{right:1rem}.ci-top-16{top:4rem}.ci-z-10{z-index:10}.ci-z-20{z-index:20}.ci-z-30{z-index:30}.ci-z-\[1\]{z-index:1}.ci-z-\[9999\]{z-index:9999}.ci-m-0{margin:0}.ci-mx-3{margin-left:.75rem;margin-right:.75rem}.ci-my-1{margin-top:.25rem;margin-bottom:.25rem}.ci--mt-1\.5{margin-top:-.375rem}.ci-mb-1{margin-bottom:.25rem}.ci-mb-1\.5{margin-bottom:.375rem}.ci-mb-3{margin-bottom:.75rem}.ci-mt-0\.5{margin-top:.125rem}.ci-mt-1{margin-top:.25rem}.ci-mt-2{margin-top:.5rem}.ci-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ci-block{display:block}.ci-flex{display:flex}.ci-grid{display:grid}.ci-hidden{display:none}.ci-h-10{height:2.5rem}.ci-h-12{height:3rem}.ci-h-2\.5{height:.625rem}.ci-h-3{height:.75rem}.ci-h-5{height:1.25rem}.ci-h-6{height:1.5rem}.ci-h-64{height:16rem}.ci-h-7{height:1.75rem}.ci-h-8{height:2rem}.ci-h-9{height:2.25rem}.ci-h-\[30rem\]{height:30rem}.ci-h-full{height:100%}.ci-max-h-32{max-height:8rem}.ci-max-h-60{max-height:15rem}.ci-max-h-64{max-height:16rem}.ci-max-h-\[30rem\]{max-height:30rem}.ci-min-h-0{min-height:0}.ci-w-0{width:0}.ci-w-10{width:2.5rem}.ci-w-12{width:3rem}.ci-w-2\.5{width:.625rem}.ci-w-3{width:.75rem}.ci-w-5{width:1.25rem}.ci-w-7{width:1.75rem}.ci-w-8{width:2rem}.ci-w-9{width:2.25rem}.ci-w-\[21rem\]{width:21rem}.ci-w-\[22rem\]{width:22rem}.ci-w-auto{width:auto}.ci-w-full{width:100%}.ci-min-w-0{min-width:0}.ci-min-w-5{min-width:1.25rem}.ci-max-w-\[80\%\]{max-width:80%}.ci-max-w-full{max-width:100%}.ci-flex-1{flex:1}.ci-shrink-0{flex-shrink:0}.ci--translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ci-transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ci-pulse{50%{opacity:.5}}.ci-animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite ci-pulse}.ci-cursor-grab{cursor:grab}.ci-cursor-pointer{cursor:pointer}.ci-cursor-text{cursor:text}.ci-touch-none{touch-action:none}.ci-select-none{-webkit-user-select:none;user-select:none}.ci-select-text{-webkit-user-select:text;user-select:text}.ci-resize-none{resize:none}.ci-list-none{list-style-type:none}.ci-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.ci-flex-col{flex-direction:column}.ci-flex-col-reverse{flex-direction:column-reverse}.ci-flex-wrap{flex-wrap:wrap}.ci-content-center{align-content:center}.ci-items-start{align-items:flex-start}.ci-items-end{align-items:flex-end}.ci-items-center{align-items:center}.ci-justify-start{justify-content:flex-start}.ci-justify-end{justify-content:flex-end}.ci-justify-center{justify-content:center}.ci-gap-0\.5{gap:.125rem}.ci-gap-1{gap:.25rem}.ci-gap-1\.5{gap:.375rem}.ci-gap-2{gap:.5rem}.ci-gap-3{gap:.75rem}.ci-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.ci-self-center{align-self:center}.ci-overflow-hidden{overflow:hidden}.ci-overflow-x-auto{overflow-x:auto}.ci-overflow-y-auto{overflow-y:auto}.ci-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ci-whitespace-nowrap{white-space:nowrap}.ci-whitespace-pre{white-space:pre}.ci-whitespace-pre-wrap{white-space:pre-wrap}.ci-break-words{overflow-wrap:break-word}.ci-break-all{word-break:break-all}.ci-rounded{border-radius:.25rem}.ci-rounded-2xl{border-radius:1rem}.ci-rounded-3xl{border-radius:1.5rem}.ci-rounded-full{border-radius:9999px}.ci-rounded-lg{border-radius:.5rem}.ci-rounded-xl{border-radius:.75rem}.ci-rounded-b-3xl{border-bottom-right-radius:1.5rem;border-bottom-left-radius:1.5rem}.ci-rounded-t-3xl{border-top-left-radius:1.5rem;border-top-right-radius:1.5rem}.ci-rounded-bl-lg{border-bottom-left-radius:.5rem}.ci-rounded-br-lg{border-bottom-right-radius:.5rem}.ci-border{border-width:1px}.ci-border-0{border-width:0}.ci-border-b{border-bottom-width:1px}.ci-border-b-2{border-bottom-width:2px}.ci-border-l-4{border-left-width:4px}.ci-border-t{border-top-width:1px}.ci-border-solid{border-style:solid}.ci-border-emerald-400{--tw-border-opacity:1;border-color:rgb(52 211 153/var(--tw-border-opacity,1))}.ci-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.ci-border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity,1))}.ci-border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.ci-border-iconSecondary{--tw-border-opacity:1;border-color:rgb(67 56 202/var(--tw-border-opacity,1))}.ci-border-transparent{border-color:#0000}.ci-bg-black\/10{background-color:#0000001a}.ci-bg-black\/20{background-color:#0003}.ci-bg-black\/5{background-color:#0000000d}.ci-bg-elevationL2{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.ci-bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.ci-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.ci-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.ci-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.ci-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-iconSecondary{--tw-bg-opacity:1;background-color:rgb(67 56 202/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandActive{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandCall{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.ci-bg-phoneIslandClose{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.ci-bg-transparent{background-color:#0000}.ci-object-cover{-o-object-fit:cover;object-fit:cover}.ci-p-0{padding:0}.ci-p-1{padding:.25rem}.ci-p-2{padding:.5rem}.ci-px-1{padding-left:.25rem;padding-right:.25rem}.ci-px-1\.5{padding-left:.375rem;padding-right:.375rem}.ci-px-2{padding-left:.5rem;padding-right:.5rem}.ci-px-2\.5{padding-left:.625rem;padding-right:.625rem}.ci-px-3{padding-left:.75rem;padding-right:.75rem}.ci-px-3\.5{padding-left:.875rem;padding-right:.875rem}.ci-px-4{padding-left:1rem;padding-right:1rem}.ci-px-5{padding-left:1.25rem;padding-right:1.25rem}.ci-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.ci-py-1{padding-top:.25rem;padding-bottom:.25rem}.ci-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.ci-py-2{padding-top:.5rem;padding-bottom:.5rem}.ci-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.ci-py-3{padding-top:.75rem;padding-bottom:.75rem}.ci-py-6{padding-top:1.5rem;padding-bottom:1.5rem}.ci-pb-1\.5{padding-bottom:.375rem}.ci-pb-2{padding-bottom:.5rem}.ci-pl-11{padding-left:2.75rem}.ci-pl-2{padding-left:.5rem}.ci-pl-2\.5{padding-left:.625rem}.ci-pl-3{padding-left:.75rem}.ci-pr-1{padding-right:.25rem}.ci-pr-1\.5{padding-right:.375rem}.ci-pr-2{padding-right:.5rem}.ci-pr-4{padding-right:1rem}.ci-pt-2{padding-top:.5rem}.ci-text-left{text-align:left}.ci-text-center{text-align:center}.ci-text-right{text-align:right}.ci-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ci-font-sans{font-family:Poppins,Inter,system-ui,sans-serif}.ci-text-\[0\.85em\]{font-size:.85em}.ci-text-\[10px\]{font-size:10px}.ci-text-lg{font-size:1.125rem;line-height:1.75rem}.ci-text-sm{font-size:.875rem;line-height:1.25rem}.ci-text-xs{font-size:.75rem;line-height:1rem}.ci-font-light{font-weight:300}.ci-font-medium{font-weight:500}.ci-italic{font-style:italic}.ci-not-italic{font-style:normal}.ci-leading-4{line-height:1rem}.ci-leading-none{line-height:1}.ci-tracking-wide{letter-spacing:.025em}.ci-text-gray-50{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.ci-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.ci-text-inherit{color:inherit}.ci-text-primaryInvert{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity,1))}.ci-text-secondaryNeutral{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.ci-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.ci-underline{text-decoration-line:underline}.ci-opacity-0{opacity:0}.ci-opacity-100{opacity:1}.ci-opacity-60{opacity:.6}.ci-opacity-80{opacity:.8}.ci-shadow-2xl{--tw-shadow:0 25px 50px -12px #00000040;--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-shadow-xl{--tw-shadow:0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.ci-outline-none{outline-offset:2px;outline:2px solid #0000}.ci-ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ci-ring-gray-300{--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.ci-ring-gray-50{--tw-ring-opacity:1;--tw-ring-color:rgb(249 250 251/var(--tw-ring-opacity,1))}.ci-ring-iconSecondary{--tw-ring-opacity:1;--tw-ring-color:rgb(67 56 202/var(--tw-ring-opacity,1))}.ci-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ci-duration-200{transition-duration:.2s}.chat-island-root,.chat-island-root *{box-sizing:border-box}.chat-island-root{font-family:Poppins,Inter,system-ui,sans-serif;font-size:14px;line-height:1.4}:where(.chat-island-root) button:not(z),:where(.chat-island-root) input:not(z),:where(.chat-island-root) textarea:not(z){box-shadow:none;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-transform:none;outline-offset:0;background:0 0;border:0 solid #0000;border-radius:0;width:auto;min-width:0;max-width:none;height:auto;min-height:0;margin:0;padding:0}:where(.chat-island-root) button:not(z){cursor:pointer}:where(.chat-island-root),:where(.chat-island-root) :not(z),:where(.chat-island-root) :before,:where(.chat-island-root) :after{border:0 solid #e5e7eb}:where(.chat-island-root) :is(h1,h2,h3,h4,h5,h6,p,blockquote,figure,pre,ol,ul):not(z){margin:0}:where(.chat-island-root) :is(ol,ul):not(z){padding:0;list-style:none}:where(.chat-island-root) :is(img,svg,video,audio,canvas):not(z){vertical-align:middle;display:block}:where(.chat-island-root) :is(img,video):not(z){max-width:100%;height:auto}.chat-island-root ::-webkit-scrollbar{width:6px}.chat-island-root ::-webkit-scrollbar-thumb{background:#9ca3af80;border-radius:9999px}.placeholder\:ci-text-gray-500::placeholder{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.hover\:ci-scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-scale-125:hover{--tw-scale-x:1.25;--tw-scale-y:1.25;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:ci-bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\:ci-bg-gray-300\/70:hover{background-color:#d1d5dbb3}.hover\:ci-bg-gray-500:hover{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCallHover:hover{--tw-bg-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity,1))}.hover\:ci-bg-phoneIslandCloseHover:hover{--tw-bg-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity,1))}.hover\:ci-opacity-100:hover{opacity:1}.focus\:ci-z-20:focus{z-index:20}.focus\:ci-opacity-100:focus{opacity:1}.focus\:ci-ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ci-ring-emerald-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(16 185 129/var(--tw-ring-opacity,1))}.focus\:ci-ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(156 163 175/var(--tw-ring-opacity,1))}.focus\:ci-ring-green-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity,1))}.focus\:ci-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\:ci-ring-offset-white:focus{--tw-ring-offset-color:#fff}.active\:ci-cursor-grabbing:active{cursor:grabbing}.enabled\:hover\:ci-border-gray-500:hover:enabled{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-opacity,1))}.enabled\:hover\:ci-bg-gray-300\/70:hover:enabled{background-color:#d1d5dbb3}.enabled\:hover\:ci-bg-gray-500:hover:enabled{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.disabled\:ci-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:ci-opacity-40:disabled{opacity:.4}.ci-group:focus-within .group-focus-within\:ci-flex,.ci-group:hover .group-hover\:ci-flex{display:flex}.ci-group:hover .group-hover\:ci-opacity-100{opacity:1}.dark\:ci-border-emerald-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(5 150 105/var(--tw-border-opacity,1))}.dark\:ci-border-gray-600:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity,1))}.dark\:ci-border-gray-700:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity,1))}.dark\:ci-border-iconSecondaryDark:is(.ci-dark *){--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.dark\:ci-bg-black\/10:is(.ci-dark *){background-color:#0000001a}.dark\:ci-bg-elevationL2Dark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-emerald-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(2 44 34/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-300:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-600:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-800:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-900:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:ci-bg-gray-950:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(3 7 18/var(--tw-bg-opacity,1))}.dark\:ci-bg-iconSecondaryDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandActiveDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCallDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.dark\:ci-bg-phoneIslandCloseDark:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.dark\:ci-bg-white\/10:is(.ci-dark *){background-color:#ffffff1a}.dark\:ci-text-gray-200:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-gray-400:is(.ci-dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:ci-text-gray-900:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-gray-950:is(.ci-dark *){--tw-text-opacity:1;color:rgb(3 7 18/var(--tw-text-opacity,1))}.dark\:ci-text-primaryInvertDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.dark\:ci-text-secondaryNeutralDark:is(.ci-dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.dark\:ci-text-white:is(.ci-dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\:ci-ring-gray-700:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(55 65 81/var(--tw-ring-opacity,1))}.dark\:ci-ring-gray-950:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(3 7 18/var(--tw-ring-opacity,1))}.dark\:ci-ring-iconSecondaryDark:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:placeholder\:ci-text-gray-400:is(.ci-dark *)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.dark\:hover\:ci-bg-gray-50:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-600:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-gray-700\/30:hover:is(.ci-dark *){background-color:#3741514d}.dark\:hover\:ci-bg-gray-800:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCallHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(134 239 172/var(--tw-bg-opacity,1))}.dark\:hover\:ci-bg-phoneIslandCloseHoverDark:hover:is(.ci-dark *){--tw-bg-opacity:1;background-color:rgb(252 165 165/var(--tw-bg-opacity,1))}.dark\:focus\:ci-ring-emerald-300:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(110 231 183/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-gray-500:focus:is(.ci-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity,1))}.dark\:focus\:ci-ring-offset-black:focus:is(.ci-dark *){--tw-ring-offset-color:#000}.dark\:enabled\:hover\:ci-bg-gray-700\/30:hover:enabled:is(.ci-dark *){background-color:#3741514d}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
`).replace(xi,``)}function Ci(e,t,n){if(t=Si(t),Si(e)!==t&&n)throw Error(r(425))}function wi(){}var Ti=null,Ei=null;function Di(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oi=typeof setTimeout==`function`?setTimeout:void 0,ki=typeof clearTimeout==`function`?clearTimeout:void 0,Ai=typeof Promise==`function`?Promise:void 0,ji=typeof queueMicrotask==`function`?queueMicrotask:Ai===void 0?Oi:function(e){return Ai.resolve(null).then(e).catch(Mi)};function Mi(e){setTimeout(function(){throw e})}function Ni(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),xn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);xn(t)}function Pi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Fi(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ii=Math.random().toString(36).slice(2),Li=`__reactFiber$`+Ii,Ri=`__reactProps$`+Ii,zi=`__reactContainer$`+Ii,Bi=`__reactEvents$`+Ii,Vi=`__reactListeners$`+Ii,Hi=`__reactHandles$`+Ii;function Ui(e){var t=e[Li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zi]||n[Li]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fi(e);e!==null;){if(n=e[Li])return n;e=Fi(e)}return t}e=n,n=e.parentNode}return null}function Wi(e){return e=e[Li]||e[zi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ki(e){return e[Ri]||null}var qi=[],Ji=-1;function Yi(e){return{current:e}}function z(e){0>Ji||(e.current=qi[Ji],qi[Ji]=null,Ji--)}function B(e,t){Ji++,qi[Ji]=e.current,e.current=t}var Xi={},Zi=Yi(Xi),Qi=Yi(!1),$i=Xi;function ea(e,t){var n=e.type.contextTypes;if(!n)return Xi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function na(){z(Qi),z(Zi)}function ra(e,t,n){if(Zi.current!==Xi)throw Error(r(168));B(Zi,t),B(Qi,n)}function ia(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,_e(e)||`Unknown`,a));return D({},n,i)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xi,$i=Zi.current,B(Zi,e),B(Qi,Qi.current),!0}function oa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ia(e,t,$i),i.__reactInternalMemoizedMergedChildContext=e,z(Qi),z(Zi),B(Zi,e)):z(Qi),B(Qi,n)}var sa=null,ca=!1,la=!1;function ua(e){sa===null?sa=[e]:sa.push(e)}function da(e){ca=!0,ua(e)}function fa(){if(!la&&sa!==null){la=!0;var e=0,t=j;try{var n=sa;for(j=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sa=null,ca=!1}catch(t){throw sa!==null&&(sa=sa.slice(e+1)),St(Dt,fa),t}finally{j=t,la=!1}}return null}var pa=[],ma=0,ha=null,ga=0,_a=[],va=0,ya=null,ba=1,xa=``;function Sa(e,t){pa[ma++]=ga,pa[ma++]=ha,ha=e,ga=t}function Ca(e,t,n){_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ya=e;var r=ba;e=xa;var i=32-Ft(r)-1;r&=~(1<<i),n+=1;var a=32-Ft(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ba=1<<32-Ft(t)+i|n<<i|r,xa=a+e}else ba=1<<a|n<<i|r,xa=e}function wa(e){e.return!==null&&(Sa(e,1),Ca(e,1,0))}function Ta(e){for(;e===ha;)ha=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null;for(;e===ya;)ya=_a[--va],_a[va]=null,xa=_a[--va],_a[va]=null,ba=_a[--va],_a[va]=null}var Ea=null,Da=null,V=!1,Oa=null;function ka(e,t){var n=Kl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Aa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Ea=e,Da=Pi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Ea=e,Da=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ya===null?null:{id:ba,overflow:xa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Da=null,!0);default:return!1}}function ja(e){return!!(e.mode&1)&&!(e.flags&128)}function Ma(e){if(V){var t=Da;if(t){var n=t;if(!Aa(e,t)){if(ja(e))throw Error(r(418));t=Pi(n.nextSibling);var i=Ea;t&&Aa(e,t)?ka(i,n):(e.flags=e.flags&-4097|2,V=!1,Ea=e)}}else{if(ja(e))throw Error(r(418));e.flags=e.flags&-4097|2,V=!1,Ea=e}}}function Na(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function Pa(e){if(e!==Ea)return!1;if(!V)return Na(e),V=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Di(e.type,e.memoizedProps)),t&&=Da){if(ja(e))throw Fa(),Error(r(418));for(;t;)ka(e,t),t=Pi(t.nextSibling)}if(Na(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Da=Pi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Da=null}}else Da=Ea?Pi(e.stateNode.nextSibling):null;return!0}function Fa(){for(var e=Da;e;)e=Pi(e.nextSibling)}function Ia(){Da=Ea=null,V=!1}function La(e){Oa===null?Oa=[e]:Oa.push(e)}var Ra=C.ReactCurrentBatchConfig;function za(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ba(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Va(e){var t=e._init;return t(e._payload)}function Ha(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=Yl(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=$l(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===ee?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ce&&Va(i)===t.type)?(r=a(t,n.props),r.ref=za(e,t,n),r.return=e,r):(r=Xl(n.type,n.key,n.props,null,e.mode,r),r.ref=za(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=eu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Zl(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=$l(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=Xl(t.type,t.key,t.props,null,e.mode,n),n.ref=za(e,null,t),n.return=e,n;case T:return t=eu(t,e.mode,n),t.return=e,t;case ce:var r=t._init;return f(e,r(t._payload),n)}if(ke(t)||de(t))return t=Zl(t,e.mode,n,null),t.return=e,t;Ba(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case ce:return i=n._init,p(e,t,i(n._payload),r)}if(ke(n)||de(n))return i===null?d(e,t,n,r,null):null;Ba(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:var a=r._init;return m(e,t,n,a(r._payload),i)}if(ke(r)||de(r))return e=e.get(n)||null,d(t,e,r,i,null);Ba(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),V&&Sa(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return V&&Sa(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),V&&Sa(r,h),l}function g(a,s,c,l){var u=de(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),V&&Sa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return V&&Sa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),V&&Sa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===ee&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===ee){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===ce&&Va(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=za(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===ee?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=za(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case ce:return l=i._init,_(e,r,l(i._payload),o)}if(ke(i))return h(e,r,i,o);if(de(i))return g(e,r,i,o);Ba(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ua=Ha(!0),Wa=Ha(!1),Ga=Yi(null),Ka=null,qa=null,Ja=null;function Ya(){Ja=qa=Ka=null}function Xa(e){var t=Ga.current;z(Ga),e._currentValue=t}function Za(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Qa(e,t){Ka=e,Ja=qa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rs=!0),e.firstContext=null)}function $a(e){var t=e._currentValue;if(Ja!==e){if(e={context:e,memoizedValue:t,next:null},qa===null){if(Ka===null)throw Error(r(308));qa=e,Ka.dependencies={lanes:0,firstContext:e}}else qa=qa.next=e}return t}var eo=null;function to(e){eo===null?eo=[e]:eo.push(e)}function no(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,to(t)):(n.next=i.next,i.next=n),t.interleaved=n,ro(e,r)}function ro(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ro(e,n)}return i=r.interleaved,i===null?(t.next=t,to(r)):(t.next=i.next,i.next=t),r.interleaved=t,ro(e,n)}function lo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xt(e,n)}}function uo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fo(e,t,n,r){var i=e.updateQueue;io=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:io=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Yc|=o,e.lanes=o,e.memoizedState=d}}function po(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var mo={},ho=Yi(mo),go=Yi(mo),_o=Yi(mo);function vo(e){if(e===mo)throw Error(r(174));return e}function yo(e,t){switch(B(_o,t),B(go,e),B(ho,mo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ie(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ie(t,e)}z(ho),B(ho,t)}function bo(){z(ho),z(go),z(_o)}function xo(e){vo(_o.current);var t=vo(ho.current),n=Ie(t,e.type);t!==n&&(B(go,e),B(ho,n))}function So(e){go.current===e&&(z(ho),z(go))}var H=Yi(0);function Co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wo=[];function To(){for(var e=0;e<wo.length;e++)wo[e]._workInProgressVersionPrimary=null;wo.length=0}var Eo=C.ReactCurrentDispatcher,Do=C.ReactCurrentBatchConfig,Oo=0,U=null,W=null,G=null,ko=!1,Ao=!1,jo=0,Mo=0;function No(){throw Error(r(321))}function Po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nr(e[n],t[n]))return!1;return!0}function Fo(e,t,n,i,a,o){if(Oo=o,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Eo.current=e===null||e.memoizedState===null?vs:ys,e=n(i,a),Ao){o=0;do{if(Ao=!1,jo=0,25<=o)throw Error(r(301));o+=1,G=W=null,t.updateQueue=null,Eo.current=bs,e=n(i,a)}while(Ao)}if(Eo.current=_s,t=W!==null&&W.next!==null,Oo=0,G=W=U=null,ko=!1,t)throw Error(r(300));return e}function Io(){var e=jo!==0;return jo=0,e}function Lo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?U.memoizedState=G=e:G=G.next=e,G}function Ro(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=G===null?U.memoizedState:G.next;if(t!==null)G=t,W=e;else{if(e===null)throw Error(r(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},G===null?U.memoizedState=G=e:G=G.next=e}return G}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){var t=Ro(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=W,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Oo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,U.lanes|=d,Yc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Nr(i,t.memoizedState)||(Rs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,U.lanes|=o,Yc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vo(e){var t=Ro(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Nr(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ho(){}function Uo(e,t){var n=U,i=Ro(),a=t(),o=!Nr(i.memoizedState,a);if(o&&(i.memoizedState=a,Rs=!0),i=i.queue,ts(Ko.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||G!==null&&G.memoizedState.tag&1){if(n.flags|=2048,Xo(9,Go.bind(null,n,i,a,t),void 0,null),Y===null)throw Error(r(349));Oo&30||Wo(n,t,a)}return a}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nr(e,n)}catch{return!0}}function Jo(e){var t=ro(e,1);t!==null&&hl(t,e,1,-1)}function Yo(e){var t=Lo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t.queue=e,e=e.dispatch=ps.bind(null,U,e),[t.memoizedState,e]}function Xo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Zo(){return Ro().memoizedState}function Qo(e,t,n,r){var i=Lo();U.flags|=e,i.memoizedState=Xo(1|t,n,void 0,r===void 0?null:r)}function $o(e,t,n,r){var i=Ro();r=r===void 0?null:r;var a=void 0;if(W!==null){var o=W.memoizedState;if(a=o.destroy,r!==null&&Po(r,o.deps)){i.memoizedState=Xo(t,n,a,r);return}}U.flags|=e,i.memoizedState=Xo(1|t,n,a,r)}function es(e,t){return Qo(8390656,8,e,t)}function ts(e,t){return $o(2048,8,e,t)}function ns(e,t){return $o(4,2,e,t)}function rs(e,t){return $o(4,4,e,t)}function is(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function as(e,t,n){return n=n==null?null:n.concat([e]),$o(4,4,is.bind(null,t,e),n)}function os(){}function ss(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cs(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ls(e,t,n){return Oo&21?(Nr(n,t)||(n=Kt(),U.lanes|=n,Yc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rs=!0),e.memoizedState=n)}function us(e,t){var n=j;j=n!==0&&4>n?n:4,e(!0);var r=Do.transition;Do.transition={};try{e(!1),t()}finally{j=n,Do.transition=r}}function ds(){return Ro().memoizedState}function fs(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e))hs(t,n);else if(n=no(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),gs(n,t,r)}}function ps(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,o)){var c=t.interleaved;c===null?(i.next=i,to(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=no(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),gs(n,t,r))}}function ms(e){var t=e.alternate;return e===U||t!==null&&t===U}function hs(e,t){Ao=ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xt(e,n)}}var _s={readContext:$a,useCallback:No,useContext:No,useEffect:No,useImperativeHandle:No,useInsertionEffect:No,useLayoutEffect:No,useMemo:No,useReducer:No,useRef:No,useState:No,useDebugValue:No,useDeferredValue:No,useTransition:No,useMutableSource:No,useSyncExternalStore:No,useId:No,unstable_isNewReconciler:!1},vs={readContext:$a,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:$a,useEffect:es,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Qo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qo(4,2,e,t)},useMemo:function(e,t){var n=Lo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fs.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:Yo,useDebugValue:os,useDeferredValue:function(e){return Lo().memoizedState=e},useTransition:function(){var e=Yo(!1),t=e[0];return e=us.bind(null,e[1]),Lo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=U,a=Lo();if(V){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Y===null)throw Error(r(349));Oo&30||Wo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,es(Ko.bind(null,i,o,e),[e]),i.flags|=2048,Xo(9,Go.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Lo(),t=Y.identifierPrefix;if(V){var n=xa,r=ba;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=jo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Mo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ys={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Bo,useRef:Zo,useState:function(){return Bo(zo)},useDebugValue:os,useDeferredValue:function(e){return ls(Ro(),W.memoizedState,e)},useTransition:function(){return[Bo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1},bs={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Vo,useRef:Zo,useState:function(){return Vo(zo)},useDebugValue:os,useDeferredValue:function(e){var t=Ro();return W===null?t.memoizedState=e:ls(t,W.memoizedState,e)},useTransition:function(){return[Vo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1};function xs(e,t){if(e&&e.defaultProps){for(var n in t=D({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ss(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cs={isMounted:function(e){return(e=e._reactInternals)?gt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pl(),r=ml(e),i=so(n,r);i.tag=2,t!=null&&(i.callback=t),t=co(e,i,r),t!==null&&(hl(t,e,r,n),lo(t,e,r))}};function ws(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Pr(n,r)||!Pr(i,a):!0}function Ts(e,t,n){var r=!1,i=Xi,a=t.contextType;return typeof a==`object`&&a?a=$a(a):(i=ta(t)?$i:Zi.current,r=t.contextTypes,a=(r=r!=null)?ea(e,i):Xi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Es(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Cs.enqueueReplaceState(t,t.state,null)}function Ds(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ao(e);var a=t.contextType;typeof a==`object`&&a?i.context=$a(a):(a=ta(t)?$i:Zi.current,i.context=ea(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ss(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Cs.enqueueReplaceState(i,i.state,null),fo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Os(e,t){try{var n=``,r=t;do n+=he(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function ks(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function As(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var js=typeof WeakMap==`function`?WeakMap:Map;function Ms(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,il=r),As(e,t)},n}function Ns(e,t,n){n=so(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){As(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){As(e,t),typeof r!=`function`&&(al===null?al=new Set([this]):al.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ps(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new js;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=zl.bind(null,e,t,n),t.then(e,e))}function Fs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Is(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=so(-1,1),t.tag=2,co(n,t,1))),n.lanes|=1),e)}var Ls=C.ReactCurrentOwner,Rs=!1;function zs(e,t,n,r){t.child=e===null?Wa(t,null,n,r):Ua(t,e.child,n,r)}function Bs(e,t,n,r,i){n=n.render;var a=t.ref;return Qa(t,i),r=Fo(e,t,n,r,a,i),n=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&n&&wa(t),t.flags|=1,zs(e,t,r,i),t.child)}function Vs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Hs(e,t,a,r,i)):(e=Xl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Pr:n,n(o,r)&&e.ref===t.ref)return oc(e,t,i)}return t.flags|=1,e=Yl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pr(a,r)&&e.ref===t.ref){if(Rs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Rs=!0);else return t.lanes=e.lanes,oc(e,t,i)}}return Gs(e,t,n,r,i)}function Us(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},B(qc,Kc),Kc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,B(qc,Kc),Kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,B(qc,Kc),Kc|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),B(qc,Kc),Kc|=r;return zs(e,t,i,n),t.child}function Ws(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gs(e,t,n,r,i){var a=ta(n)?$i:Zi.current;return a=ea(t,a),Qa(t,i),n=Fo(e,t,n,r,a,i),r=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&r&&wa(t),t.flags|=1,zs(e,t,n,i),t.child)}function Ks(e,t,n,r,i){if(ta(n)){var a=!0;aa(t)}else a=!1;if(Qa(t,i),t.stateNode===null)ac(e,t),Ts(t,n,r),Ds(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=$a(l):(l=ta(n)?$i:Zi.current,l=ea(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Es(t,o,r,l),io=!1;var f=t.memoizedState;o.state=f,fo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Qi.current||io?(typeof u==`function`&&(Ss(t,n,u,r),c=t.memoizedState),(s=io||ws(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,oo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:xs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=$a(c):(c=ta(n)?$i:Zi.current,c=ea(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Es(t,o,r,c),io=!1,f=t.memoizedState,o.state=f,fo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Qi.current||io?(typeof p==`function`&&(Ss(t,n,p,r),m=t.memoizedState),(l=io||ws(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return qs(e,t,n,r,a,i)}function qs(e,t,n,r,i,a){Ws(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&oa(t,n,!1),oc(e,t,a);r=t.stateNode,Ls.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ua(t,e.child,null,a),t.child=Ua(t,null,s,a)):zs(e,t,s,a),t.memoizedState=r.state,i&&oa(t,n,!0),t.child}function Js(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),yo(e,t.containerInfo)}function Ys(e,t,n,r,i){return Ia(),La(i),t.flags|=256,zs(e,t,n,r),t.child}var Xs={dehydrated:null,treeContext:null,retryLane:0};function Zs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qs(e,t,n){var r=t.pendingProps,i=H.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),B(H,i&1),e===null)return Ma(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ql(o,r,0,null),e=Zl(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Zs(n),t.memoizedState=Xs,e):$s(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return tc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Yl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Zl(a,o,n,null),a.flags|=2):a=Yl(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Zs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Xs,r}return a=e.child,e=a.sibling,r=Yl(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $s(e,t){return t=Ql({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&La(r),Ua(t,e.child,null,n),e=$s(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=ks(Error(r(422))),ec(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=Ql({mode:`visible`,children:i.children},a,0,null),o=Zl(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ua(t,e.child,null,s),t.child.memoizedState=Zs(s),t.memoizedState=Xs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ec(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=ks(o,i,void 0),ec(e,t,s,i)}if(c=(s&e.childLanes)!==0,Rs||c){if(i=Y,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,ro(e,a),hl(i,e,a,-1))}return kl(),i=ks(Error(r(421))),ec(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Vl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Da=Pi(a.nextSibling),Ea=t,V=!0,Oa=null,e!==null&&(_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ba=e.id,xa=e.overflow,ya=t),t=$s(t,i.children),t.flags|=4096,t)}function nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Za(e.return,t,n)}function rc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ic(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(zs(e,t,r.children,n),r=H.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nc(e,n,t);else if(e.tag===19)nc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(B(H,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rc(t,!0,n,null,a);break;case`together`:rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ac(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Yl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sc(e,t,n){switch(t.tag){case 3:Js(t),Ia();break;case 5:xo(t);break;case 1:ta(t.type)&&aa(t);break;case 4:yo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;B(Ga,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(B(H,H.current&1),e=oc(e,t,n),e===null?null:e.sibling):Qs(e,t,n):(B(H,H.current&1),t.flags|=128,null);B(H,H.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ic(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(H,H.current),r)break;return null;case 22:case 23:return t.lanes=0,Us(e,t,n)}return oc(e,t,n)}var cc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},lc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,vo(ho.current);var o=null;switch(n){case`input`:i=Ce(e,i),r=Ce(e,r),o=[];break;case`select`:i=D({},i,{value:void 0}),r=D({},r,{value:void 0}),o=[];break;case`textarea`:i=je(e,i),r=je(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=wi)}Ge(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&R(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},uc=function(e,t,n,r){n!==r&&(t.flags|=4)};function dc(e,t){if(!V)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function pc(e,t,n){var i=t.pendingProps;switch(Ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fc(t),null;case 1:return ta(t.type)&&na(),fc(t),null;case 3:return i=t.stateNode,bo(),z(Qi),z(Zi),To(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Pa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Oa!==null&&(yl(Oa),Oa=null))),fc(t),null;case 5:So(t);var o=vo(_o.current);if(n=t.type,e!==null&&t.stateNode!=null)lc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return fc(t),null}if(e=vo(ho.current),Pa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Li]=t,i[Ri]=s,e=!!(t.mode&1),n){case`dialog`:R(`cancel`,i),R(`close`,i);break;case`iframe`:case`object`:case`embed`:R(`load`,i);break;case`video`:case`audio`:for(o=0;o<si.length;o++)R(si[o],i);break;case`source`:R(`error`,i);break;case`img`:case`image`:case`link`:R(`error`,i),R(`load`,i);break;case`details`:R(`toggle`,i);break;case`input`:we(i,s),R(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},R(`invalid`,i);break;case`textarea`:Me(i,s),R(`invalid`,i)}for(var c in Ge(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&R(`scroll`,i)}switch(n){case`input`:be(i),De(i,s,!0);break;case`textarea`:be(i),Pe(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=wi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Fe(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Li]=t,e[Ri]=i,cc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ke(n,i),n){case`dialog`:R(`cancel`,e),R(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:R(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<si.length;o++)R(si[o],e);o=i;break;case`source`:R(`error`,e),o=i;break;case`img`:case`image`:case`link`:R(`error`,e),R(`load`,e),o=i;break;case`details`:R(`toggle`,e),o=i;break;case`input`:we(e,i),o=Ce(e,i),R(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=D({},i,{value:void 0}),R(`invalid`,e);break;case`textarea`:Me(e,i),o=je(e,i),R(`invalid`,e);break;default:o=i}for(s in Ge(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ue(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Re(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&ze(e,u):typeof u==`number`&&ze(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&R(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:be(e),De(e,i,!1);break;case`textarea`:be(e),Pe(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+k(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Ae(e,!!i.multiple,i.defaultValue,!0):Ae(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=wi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return fc(t),null;case 6:if(e&&t.stateNode!=null)uc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=vo(_o.current),vo(ho.current),Pa(t)){if(i=t.stateNode,n=t.memoizedProps,i[Li]=t,(s=i.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:Ci(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ci(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Li]=t,t.stateNode=i}return fc(t),null;case 13:if(z(H),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(V&&Da!==null&&t.mode&1&&!(t.flags&128))Fa(),Ia(),t.flags|=98560,s=!1;else if(s=Pa(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Li]=t}else Ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fc(t),s=!1}else Oa!==null&&(yl(Oa),Oa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||H.current&1?Q===0&&(Q=3):kl())),t.updateQueue!==null&&(t.flags|=4),fc(t),null);case 4:return bo(),e===null&&pi(t.stateNode.containerInfo),fc(t),null;case 10:return Xa(t.type._context),fc(t),null;case 17:return ta(t.type)&&na(),fc(t),null;case 19:if(z(H),s=t.memoizedState,s===null)return fc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)dc(s,!1);else{if(Q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Co(e),c!==null){for(t.flags|=128,dc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return B(H,H.current&1|2),t.child}e=e.sibling}s.tail!==null&&A()>tl&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=Co(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!V)return fc(t),null}else 2*A()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(fc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=A(),t.sibling=null,n=H.current,B(H,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Kc&1073741824&&(fc(t),t.subtreeFlags&6&&(t.flags|=8192)):fc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function mc(e,t){switch(Ta(t),t.tag){case 1:return ta(t.type)&&na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bo(),z(Qi),z(Zi),To(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return So(t),null;case 13:if(z(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(H),null;case 4:return bo(),null;case 10:return Xa(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var hc=!1,gc=!1,_c=typeof WeakSet==`function`?WeakSet:Set,K=null;function vc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}}function yc(e,t,n){try{n()}catch(n){$(e,t,n)}}var bc=!1;function xc(e,t){if(Ti=Sn,e=Rr(),zr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ei={focusedElem:e,selectionRange:n},Sn=!1,K=t;K!==null;)if(t=K,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:xs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return h=bc,bc=!1,h}function Sc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Li],delete t[Ri],delete t[Bi],delete t[Vi],delete t[Hi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wi));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var q=null,Ac=!1;function jc(e,t,n){for(n=n.child;n!==null;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount==`function`)try{Nt.onCommitFiberUnmount(Mt,n)}catch{}switch(n.tag){case 5:gc||vc(n,t);case 6:var r=q,i=Ac;q=null,jc(e,t,n),q=r,Ac=i,q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?Ni(e.parentNode,n):e.nodeType===1&&Ni(e,n),xn(e)):Ni(q,n.stateNode));break;case 4:r=q,i=Ac,q=n.stateNode.containerInfo,Ac=!0,jc(e,t,n),q=r,Ac=i;break;case 0:case 11:case 14:case 15:if(!gc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&yc(n,t,o),i=i.next}while(i!==r)}jc(e,t,n);break;case 1:if(!gc&&(vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}jc(e,t,n);break;case 21:jc(e,t,n);break;case 22:n.mode&1?(gc=(r=gc)||n.memoizedState!==null,jc(e,t,n),gc=r):jc(e,t,n);break;default:jc(e,t,n)}}function Nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Pc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:q=c.stateNode,Ac=!1;break a;case 3:q=c.stateNode.containerInfo,Ac=!0;break a;case 4:q=c.stateNode.containerInfo,Ac=!0;break a}c=c.return}if(q===null)throw Error(r(160));Mc(o,s,a),q=null,Ac=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){$(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fc(t,e),t=t.sibling}function Fc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pc(t,e),Ic(e),i&4){try{Sc(3,e,e.return),Cc(3,e)}catch(t){$(e,e.return,t)}try{Sc(5,e,e.return)}catch(t){$(e,e.return,t)}}break;case 1:Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return);break;case 5:if(Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return),e.flags&32){var a=e.stateNode;try{ze(a,``)}catch(t){$(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&Te(a,o),Ke(c,s);var u=Ke(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ue(a,f):d===`dangerouslySetInnerHTML`?Re(a,f):d===`children`?ze(a,f):S(a,d,f,u)}switch(c){case`input`:Ee(a,o);break;case`textarea`:Ne(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Ae(a,!!o.multiple,o.multiple?[]:``,!1):Ae(a,!!o.multiple,o.defaultValue,!0)):Ae(a,!!o.multiple,m,!1)}a[Ri]=o}catch(t){$(e,e.return,t)}}break;case 6:if(Pc(t,e),Ic(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){$(e,e.return,t)}}break;case 3:if(Pc(t,e),Ic(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{xn(t.containerInfo)}catch(t){$(e,e.return,t)}break;case 4:Pc(t,e),Ic(e);break;case 13:Pc(t,e),Ic(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(el=A())),i&4&&Nc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(gc=(u=gc)||d,Pc(t,e),gc=u):Pc(t,e),Ic(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(K=e,d=e.child;d!==null;){for(f=K=d;K!==null;){switch(p=K,m=p.child,p.tag){case 0:case 11:case 14:case 15:Sc(4,p,p.return);break;case 1:vc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){$(i,n,e)}}break;case 5:vc(p,p.return);break;case 22:if(p.memoizedState!==null){Bc(f);continue}}m===null?Bc(f):(m.return=p,K=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=He(`display`,s))}catch(t){$(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){$(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Pc(t,e),Ic(e),i&4&&Nc(e);break;case 21:break;default:Pc(t,e),Ic(e)}}function Ic(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Ec(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(ze(a,``),i.flags&=-33),kc(e,Dc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Oc(e,Dc(e),o);break;default:throw Error(r(161))}}catch(t){$(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lc(e,t,n){K=e,Rc(e,t,n)}function Rc(e,t,n){for(var r=!!(e.mode&1);K!==null;){var i=K,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||gc;s=hc;var l=gc;if(hc=o,(gc=c)&&!l)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Vc(i):(c.return=o,K=c);for(;a!==null;)K=a,Rc(a,t,n),a=a.sibling;K=i,hc=s,gc=l}zc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,K=a):zc(e,t,n)}}function zc(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gc||Cc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!gc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:xs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&po(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}po(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&xn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}gc||t.flags&512&&wc(t)}catch(e){$(t,t.return,e)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Bc(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Vc(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cc(4,t)}catch(e){$(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){$(t,i,e)}}var a=t.return;try{wc(t)}catch(e){$(t,a,e)}break;case 5:var o=t.return;try{wc(t)}catch(e){$(t,o,e)}}}catch(e){$(t,t.return,e)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var Hc=Math.ceil,Uc=C.ReactCurrentDispatcher,Wc=C.ReactCurrentOwner,Gc=C.ReactCurrentBatchConfig,J=0,Y=null,X=null,Z=0,Kc=0,qc=Yi(0),Q=0,Jc=null,Yc=0,Xc=0,Zc=0,Qc=null,$c=null,el=0,tl=1/0,nl=null,rl=!1,il=null,al=null,ol=!1,sl=null,cl=0,ll=0,ul=null,dl=-1,fl=0;function pl(){return J&6?A():dl===-1?dl=A():dl}function ml(e){return e.mode&1?J&2&&Z!==0?Z&-Z:Ra.transition===null?(e=j,e===0?(e=window.event,e=e===void 0?16:Dn(e.type),e):e):(fl===0&&(fl=Kt()),fl):1}function hl(e,t,n,i){if(50<ll)throw ll=0,ul=null,Error(r(185));Jt(e,n,i),(!(J&2)||e!==Y)&&(e===Y&&(!(J&2)&&(Xc|=n),Q===4&&xl(e,Z)),gl(e,i),n===1&&J===0&&!(t.mode&1)&&(tl=A()+500,ca&&fa()))}function gl(e,t){var n=e.callbackNode;Wt(e,t);var r=Ht(e,e===Y?Z:0);if(r===0)n!==null&&Ct(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ct(n),t===1)e.tag===0?da(Sl.bind(null,e)):ua(Sl.bind(null,e)),ji(function(){!(J&6)&&fa()}),n=null;else{switch(Zt(r)){case 1:n=Dt;break;case 4:n=Ot;break;case 16:n=kt;break;case 536870912:n=jt;break;default:n=kt}n=Wl(n,_l.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _l(e,t){if(dl=-1,fl=0,J&6)throw Error(r(327));var n=e.callbackNode;if(Ll()&&e.callbackNode!==n)return null;var i=Ht(e,e===Y?Z:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Al(e,i);else{t=i;var a=J;J|=2;var o=Ol();(Y!==e||Z!==t)&&(nl=null,tl=A()+500,El(e,t));do try{Ml();break}catch(t){Dl(e,t)}while(1);Ya(),Uc.current=o,J=a,X===null?(Y=null,Z=0,t=Q):t=0}if(t!==0){if(t===2&&(a=Gt(e),a!==0&&(i=a,t=vl(e,a))),t===1)throw n=Jc,El(e,0),xl(e,i),gl(e,A()),n;if(t===6)xl(e,i);else{if(a=e.current.alternate,!(i&30)&&!bl(a)&&(t=Al(e,i),t===2&&(o=Gt(e),o!==0&&(i=o,t=vl(e,o))),t===1))throw n=Jc,El(e,0),xl(e,i),gl(e,A()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Fl(e,$c,nl);break;case 3:if(xl(e,i),(i&130023424)===i&&(t=el+500-A(),10<t)){if(Ht(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){pl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Oi(Fl.bind(null,e,$c,nl),t);break}Fl(e,$c,nl);break;case 4:if(xl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Ft(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=A()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Hc(i/1960))-i,10<i){e.timeoutHandle=Oi(Fl.bind(null,e,$c,nl),i);break}Fl(e,$c,nl);break;case 5:Fl(e,$c,nl);break;default:throw Error(r(329))}}}return gl(e,A()),e.callbackNode===n?_l.bind(null,e):null}function vl(e,t){var n=Qc;return e.current.memoizedState.isDehydrated&&(El(e,t).flags|=256),e=Al(e,t),e!==2&&(t=$c,$c=n,t!==null&&yl(t)),e}function yl(e){$c===null?$c=e:$c.push.apply($c,e)}function bl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xl(e,t){for(t&=~Zc,t&=~Xc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ft(t),r=1<<n;e[n]=-1,t&=~r}}function Sl(e){if(J&6)throw Error(r(327));Ll();var t=Ht(e,0);if(!(t&1))return gl(e,A()),null;var n=Al(e,t);if(e.tag!==0&&n===2){var i=Gt(e);i!==0&&(t=i,n=vl(e,i))}if(n===1)throw n=Jc,El(e,0),xl(e,t),gl(e,A()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fl(e,$c,nl),gl(e,A()),null}function Cl(e,t){var n=J;J|=1;try{return e(t)}finally{J=n,J===0&&(tl=A()+500,ca&&fa())}}function wl(e){sl!==null&&sl.tag===0&&!(J&6)&&Ll();var t=J;J|=1;var n=Gc.transition,r=j;try{if(Gc.transition=null,j=1,e)return e()}finally{j=r,Gc.transition=n,J=t,!(J&6)&&fa()}}function Tl(){Kc=qc.current,z(qc)}function El(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ki(n)),X!==null)for(n=X.return;n!==null;){var r=n;switch(Ta(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&na();break;case 3:bo(),z(Qi),z(Zi),To();break;case 5:So(r);break;case 4:bo();break;case 13:z(H);break;case 19:z(H);break;case 10:Xa(r.type._context);break;case 22:case 23:Tl()}n=n.return}if(Y=e,X=e=Yl(e.current,null),Z=Kc=t,Q=0,Jc=null,Zc=Xc=Yc=0,$c=Qc=null,eo!==null){for(t=0;t<eo.length;t++)if(n=eo[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}eo=null}return e}function Dl(e,t){do{var n=X;try{if(Ya(),Eo.current=_s,ko){for(var i=U.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}ko=!1}if(Oo=0,G=W=U=null,Ao=!1,jo=0,Wc.current=null,n===null||n.return===null){Q=1,Jc=t,X=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Z,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Fs(s);if(m!==null){m.flags&=-257,Is(m,s,c,o,t),m.mode&1&&Ps(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Ps(o,u,t),kl();break a}l=Error(r(426))}else if(V&&c.mode&1){var _=Fs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Is(_,s,c,o,t),La(Os(l,c));break a}}o=l=Os(l,c),Q!==4&&(Q=2),Qc===null?Qc=[o]:Qc.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ms(o,l,t);uo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(al===null||!al.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ns(o,c,t);uo(o,x);break a}}o=o.return}while(o!==null)}Pl(n)}catch(e){t=e,X===n&&n!==null&&(X=n=n.return);continue}break}while(1)}function Ol(){var e=Uc.current;return Uc.current=_s,e===null?_s:e}function kl(){(Q===0||Q===3||Q===2)&&(Q=4),Y===null||!(Yc&268435455)&&!(Xc&268435455)||xl(Y,Z)}function Al(e,t){var n=J;J|=2;var i=Ol();(Y!==e||Z!==t)&&(nl=null,El(e,t));do try{jl();break}catch(t){Dl(e,t)}while(1);if(Ya(),J=n,Uc.current=i,X!==null)throw Error(r(261));return Y=null,Z=0,Q}function jl(){for(;X!==null;)Nl(X)}function Ml(){for(;X!==null&&!wt();)Nl(X)}function Nl(e){var t=Ul(e.alternate,e,Kc);e.memoizedProps=e.pendingProps,t===null?Pl(e):X=t,Wc.current=null}function Pl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mc(n,t),n!==null){n.flags&=32767,X=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Q=6,X=null;return}}else if(n=pc(n,t,Kc),n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Q===0&&(Q=5)}function Fl(e,t,n){var r=j,i=Gc.transition;try{Gc.transition=null,j=1,Il(e,t,n,r)}finally{Gc.transition=i,j=r}return null}function Il(e,t,n,i){do Ll();while(sl!==null);if(J&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Yt(e,o),e===Y&&(X=Y=null,Z=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ol||(ol=!0,Wl(kt,function(){return Ll(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Gc.transition,Gc.transition=null;var s=j;j=1;var c=J;J|=4,Wc.current=null,xc(e,n),Fc(n,e),Br(Ei),Sn=!!Ti,Ei=Ti=null,e.current=n,Lc(n,e,a),Tt(),J=c,j=s,Gc.transition=o}else e.current=n;if(ol&&(ol=!1,sl=e,cl=a),o=e.pendingLanes,o===0&&(al=null),Pt(n.stateNode,i),gl(e,A()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(rl)throw rl=!1,e=il,il=null,e;return cl&1&&e.tag!==0&&Ll(),o=e.pendingLanes,o&1?e===ul?ll++:(ll=0,ul=e):ll=0,fa(),null}function Ll(){if(sl!==null){var e=Zt(cl),t=Gc.transition,n=j;try{if(Gc.transition=null,j=16>e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,J&6)throw Error(r(331));var a=J;for(J|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(K=u;K!==null;){var d=K;switch(d.tag){case 0:case 11:case 15:Sc(8,d,o)}var f=d.child;if(f!==null)f.return=d,K=f;else for(;K!==null;){d=K;var p=d.sibling,m=d.return;if(Tc(d),d===u){K=null;break}if(p!==null){p.return=m,K=p;break}K=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}K=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,K=s;else b:for(;K!==null;){if(o=K,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Sc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,K=v;break b}K=o.return}}var y=e.current;for(K=y;K!==null;){s=K;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,K=b;else b:for(s=y;K!==null;){if(c=K,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Cc(9,c)}}catch(e){$(c,c.return,e)}if(c===s){K=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,K=x;break b}K=c.return}}if(J=a,fa(),Nt&&typeof Nt.onPostCommitFiberRoot==`function`)try{Nt.onPostCommitFiberRoot(Mt,e)}catch{}i=!0}return i}finally{j=n,Gc.transition=t}}return!1}function Rl(e,t,n){t=Os(n,t),t=Ms(e,t,1),e=co(e,t,1),t=pl(),e!==null&&(Jt(e,1,t),gl(e,t))}function $(e,t,n){if(e.tag===3)Rl(e,e,n);else for(;t!==null;){if(t.tag===3){Rl(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(al===null||!al.has(r))){e=Os(n,e),e=Ns(t,e,1),t=co(t,e,1),e=pl(),t!==null&&(Jt(t,1,e),gl(t,e));break}}t=t.return}}function zl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pl(),e.pingedLanes|=e.suspendedLanes&n,Y===e&&(Z&n)===n&&(Q===4||Q===3&&(Z&130023424)===Z&&500>A()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=Bt,Bt<<=1,!(Bt&130023424)&&(Bt=4194304)):t=1);var n=pl();e=ro(e,t),e!==null&&(Jt(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Qi.current)Rs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Rs=!1,sc(e,t,n);Rs=!!(e.flags&131072)}}else Rs=!1,V&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ac(e,t),e=t.pendingProps;var a=ea(t,Zi.current);Qa(t,n),a=Fo(null,t,i,e,a,n);var o=Io();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(i)?(o=!0,aa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ao(t),a.updater=Cs,t.stateNode=a,a._reactInternals=t,Ds(t,i,e,n),t=qs(null,t,i,!0,o,n)):(t.tag=0,V&&o&&wa(t),zs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ac(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=xs(i,e),a){case 0:t=Gs(null,t,i,e,n);break a;case 1:t=Ks(null,t,i,e,n);break a;case 11:t=Bs(null,t,i,e,n);break a;case 14:t=Vs(null,t,i,xs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Gs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Ks(e,t,i,a,n);case 3:a:{if(Js(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,oo(e,t),fo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Os(Error(r(423)),t),t=Ys(e,t,i,n,a);break a}if(i!==a){a=Os(Error(r(424)),t),t=Ys(e,t,i,n,a);break a}for(Da=Pi(t.stateNode.containerInfo.firstChild),Ea=t,V=!0,Oa=null,n=Wa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ia(),i===a){t=oc(e,t,n);break a}zs(e,t,i,n)}t=t.child}return t;case 5:return xo(t),e===null&&Ma(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Di(i,a)?s=null:o!==null&&Di(i,o)&&(t.flags|=32),Ws(e,t),zs(e,t,s,n),t.child;case 6:return e===null&&Ma(t),null;case 13:return Qs(e,t,n);case 4:return yo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ua(t,null,i,n):zs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Bs(e,t,i,a,n);case 7:return zs(e,t,t.pendingProps,n),t.child;case 8:return zs(e,t,t.pendingProps.children,n),t.child;case 12:return zs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,B(Ga,i._currentValue),i._currentValue=s,o!==null){if(Nr(o.value,s)){if(o.children===a.children&&!Qi.current){t=oc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=so(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Za(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Za(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}zs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Qa(t,n),a=$a(a),i=i(a),t.flags|=1,zs(e,t,i,n),t.child;case 14:return i=t.type,a=xs(i,t.pendingProps),a=xs(i.type,a),Vs(e,t,i,a,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),ac(e,t),t.tag=1,ta(i)?(e=!0,aa(t)):e=!1,Qa(t,n),Ts(t,i,a),Ds(t,i,a,n),qs(null,t,i,!0,e,n);case 19:return ic(e,t,n);case 22:return Us(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return St(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===ae)return 11;if(e===E)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case ee:return Zl(n.children,a,o,t);case te:s=8,a|=8;break;case ne:return e=Kl(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case oe:return e=Kl(13,n,t,a),e.elementType=oe,e.lanes=o,e;case se:return e=Kl(19,n,t,a),e.elementType=se,e.lanes=o,e;case le:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case re:s=10;break a;case ie:s=9;break a;case ae:s=11;break a;case E:s=14;break a;case ce:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=le,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qt(0),this.expirationTimes=qt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ao(a),e}function ru(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function iu(e){if(!e)return Xi;e=e._reactInternals;a:{if(gt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(ta(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(ta(n))return ia(e,n,t)}return t}function au(e,t,n,r,i,a,o,s,c){return e=nu(n,r,!0,e,i,a,o,s,c),e.context=iu(null),n=e.current,r=pl(),i=ml(n),a=so(r,i),a.callback=t??null,co(n,a,i),e.current.lanes=i,Jt(e,i,r),gl(e,r),e}function ou(e,t,n,r){var i=t.current,a=pl(),o=ml(i);return n=iu(n),t.context===null?t.context=n:t.pendingContext=n,t=so(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=co(i,t,o),e!==null&&(hl(e,i,o,a),lo(e,i,o)),o}function su(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lu(e,t){cu(e,t),(e=e.alternate)&&cu(e,t)}function uu(){return null}var du=typeof reportError==`function`?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}pu.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));ou(e,t,null,null)},pu.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wl(function(){ou(null,e,null,null)}),t[zi]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=tn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<dn.length&&t!==0&&t<dn[n].priority;n++);dn.splice(n,0,e),n===0&&gn(e)}};function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function gu(){}function _u(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=su(o);a.call(e)}}var o=au(t,r,e,0,null,!1,!1,``,gu);return e._reactRootContainer=o,e[zi]=o.current,pi(e.nodeType===8?e.parentNode:e),wl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=su(c);s.call(e)}}var c=nu(e,0,!1,null,null,!1,!1,``,gu);return e._reactRootContainer=c,e[zi]=c.current,pi(e.nodeType===8?e.parentNode:e),wl(function(){ou(t,c,n,r)}),c}function vu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=su(o);s.call(e)}}ou(t,o,e,i)}else o=_u(n,t,e,i,r);return su(o)}Qt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vt(t.pendingLanes);n!==0&&(Xt(t,n|1),gl(t,A()),!(J&6)&&(tl=A()+500,fa()))}break;case 13:wl(function(){var t=ro(e,1);t!==null&&hl(t,e,1,pl())}),lu(e,1)}},$t=function(e){if(e.tag===13){var t=ro(e,134217728);t!==null&&hl(t,e,134217728,pl()),lu(e,134217728)}},en=function(e){if(e.tag===13){var t=ml(e),n=ro(e,t);n!==null&&hl(n,e,t,pl()),lu(e,t)}},tn=function(){return j},nn=function(e,t){var n=j;try{return j=e,t()}finally{j=n}},Ye=function(e,t,n){switch(t){case`input`:if(Ee(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ki(i);if(!a)throw Error(r(90));xe(i),Ee(i,a)}}}break;case`textarea`:Ne(e,n);break;case`select`:t=n.value,t!=null&&Ae(e,!!n.multiple,t,!1)}},tt=Cl,nt=wl;var yu={usingClientEntryPoint:!1,Events:[Wi,Gi,Ki,$e,et,Cl]},bu={findFiberByHostInstance:Ui,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},xu={bundleType:bu.bundleType,version:bu.version,rendererPackageName:bu.rendererPackageName,rendererConfig:bu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bt(e),e===null?null:e.stateNode},findFiberByHostInstance:bu.findFiberByHostInstance||uu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{Mt=Su.inject(xu),Nt=Su}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mu(t))throw Error(r(200));return ru(e,t,null,n)},e.createRoot=function(e,t){if(!mu(e))throw Error(r(299));var n=!1,i=``,a=du;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nu(e,1,!1,null,null,n,!1,i,a),e[zi]=t.current,pi(e.nodeType===8?e.parentNode:e),new fu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=bt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return wl(e)},e.hydrate=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!mu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=du;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=au(t,null,e,1,n??null,a,!1,o,s),e[zi]=t.current,pi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new pu(t)},e.render=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!hu(e))throw Error(r(40));return e._reactRootContainer?(wl(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[zi]=null})}),!0):!1},e.unstable_batchedUpdates=Cl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!hu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return vu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),g=c(u(),1);function _(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var{useRef:v}=g.default;function y(e){let t=v();return n=>{let r=e(n);return _(t.current,r)?t.current:t.current=r}}var b=8;function x(e,t){let[n,r]=(0,g.useState)(()=>{try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}),i=(0,g.useRef)(!1),a=(0,g.useCallback)(t=>{let n=e.current,r=n?.offsetWidth??0,i=n?.offsetHeight??0;return{right:Math.min(Math.max(b,t.right),Math.max(b,window.innerWidth-r-b)),bottom:Math.min(Math.max(b,t.bottom),Math.max(b,window.innerHeight-i-b))}},[e]);return(0,g.useEffect)(()=>{let e=()=>r(e=>e&&a(e));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[a]),{anchor:n,start:(0,g.useCallback)(n=>{if(n.button!==0)return;let o=e.current;if(!o)return;let s=o.getBoundingClientRect(),c={x:n.clientX,y:n.clientY,right:window.innerWidth-s.right,bottom:window.innerHeight-s.bottom};i.current=!1;let l=e=>{let t=e.clientX-c.x,n=e.clientY-c.y;!i.current&&Math.hypot(t,n)<5||(i.current=!0,r(a({right:c.right-t,bottom:c.bottom-n})))},u=null,d=e=>{l(e),i.current&&(u=a({right:c.right-(e.clientX-c.x),bottom:c.bottom-(e.clientY-c.y)}))},f=()=>{if(window.removeEventListener(`pointermove`,d),window.removeEventListener(`pointerup`,f),window.removeEventListener(`pointercancel`,f),i.current&&u)try{localStorage.setItem(t,JSON.stringify(u))}catch{}};window.addEventListener(`pointermove`,d),window.addEventListener(`pointerup`,f),window.addEventListener(`pointercancel`,f)},[e,a,t]),onClickCapture:(0,g.useCallback)(e=>{i.current&&=(e.stopPropagation(),e.preventDefault(),!1)},[])}}var S=o((e=>{var t={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function n(e){return t[e]}var r={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`};function i(e){if(e[1]===`#`){let t=e[2]===`x`?parseInt(e.slice(3),16):parseInt(e.slice(2),10);if(t===9||t===10||t===13||t>=32&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111)return String.fromCodePoint(t);throw Error(`Illegal XML character 0x`+t.toString(16))}if(r[e])return r[e]||e;throw Error(`Illegal XML entity `+e)}function a(e){return e.replace(/["&'<>]/g,n)}function o(e){let t=``,n=-1,r=-1,a=0;for(;(n=e.indexOf(`&`,a))!==-1&&(r=e.indexOf(`;`,n+1))!==-1;)t=t+e.slice(a,n)+i(e.slice(n,r+1)),a=r+1;return a===0?e:(t+=e.substring(a),t)}function s(e){return e.replace(/[&<>]/g,n)}function c(e){return e.replace(/&(amp|#38|lt|#60|gt|#62);/g,i)}e.escapeXML=a,e.escapeXMLText=s,e.unescapeXML=o,e.unescapeXMLText=c})),C=o(((e,t)=>{var n=S(),r=class e{constructor(e,t){this.name=e,this.parent=null,this.children=[],this.attrs={},this.setAttrs(t)}is(e,t){return this.getName()===e&&(!t||this.getNS()===t)}getName(){let e=this.name.indexOf(`:`);return e>=0?this.name.slice(e+1):this.name}getNS(){let e=this.name.indexOf(`:`);if(e>=0){let t=this.name.slice(0,e);return this.findNS(t)}return this.findNS()}findNS(e){if(e){let t=`xmlns:`+e;if(this.attrs[t])return this.attrs[t];if(this.parent)return this.parent.findNS(e)}else{if(this.attrs.xmlns)return this.attrs.xmlns;if(this.parent)return this.parent.findNS()}}getXmlns(){let e={};this.parent&&(e=this.parent.getXmlns());for(let t in this.attrs){let n=t.match(`xmlns:?(.*)`);this.attrs.hasOwnProperty(t)&&n&&(e[this.attrs[t]]=n[1])}return e}setAttrs(e){typeof e==`string`?this.attrs.xmlns=e:e&&Object.assign(this.attrs,e)}getAttr(e,t){if(!t)return this.attrs[e];let n=this.getXmlns();return n[t]?this.attrs[[n[t],e].join(`:`)]:null}getChild(e,t){return this.getChildren(e,t)[0]}getChildren(e,t){let n=[];for(let r of this.children)r.getName&&r.getName()===e&&(!t||r.getNS()===t)&&n.push(r);return n}getChildByAttr(e,t,n,r){return this.getChildrenByAttr(e,t,n,r)[0]}getChildrenByAttr(e,t,n,r){let i=[];for(let a of this.children)a.attrs&&a.attrs[e]===t&&(!n||a.getNS()===n)&&i.push(a),r&&a.getChildrenByAttr&&i.push(a.getChildrenByAttr(e,t,n,!0));return r&&(i=i.flat()),i}getChildrenByFilter(e,t){let n=[];for(let r of this.children)e(r)&&n.push(r),t&&r.getChildrenByFilter&&n.push(r.getChildrenByFilter(e,!0));return t&&(n=n.flat()),n}getText(){let e=``;for(let t of this.children)(typeof t==`string`||typeof t==`number`)&&(e+=t);return e}getChildText(e,t){let n=this.getChild(e,t);return n?n.getText():null}getChildElements(){return this.getChildrenByFilter(t=>t instanceof e)}root(){return this.parent?this.parent.root():this}up(){return this.parent?this.parent:this}c(t,n){return this.cnode(new e(t,n))}cnode(e){return this.children.push(e),typeof e==`object`&&(e.parent=this),e}append(...e){for(let t of e)this.children.push(t),typeof t==`object`&&(t.parent=this)}prepend(...e){for(let t of e)this.children.unshift(t),typeof t==`object`&&(t.parent=this)}t(e){return this.children.push(e),this}remove(e,t){let n=typeof e==`string`?n=>!(n.is&&n.is(e,t)):t=>t!==e;return this.children=this.children.filter(n),this}text(e){return e&&this.children.length===1?(this.children[0]=e,this):this.getText()}attr(e,t){return t!==void 0||t===null?(this.attrs||={},this.attrs[e]=t,this):this.attrs[e]}toString(){let e=``;return this.write(t=>{e+=t}),e}_addChildren(e){e(`>`);for(let t of this.children)t!=null&&(t.write?t.write(e):typeof t==`string`?e(n.escapeXMLText(t)):t.toString&&e(n.escapeXMLText(t.toString(10))));e(`</`),e(this.name),e(`>`)}write(e){e(`<`),e(this.name);for(let t in this.attrs){let r=this.attrs[t];r!=null&&(e(` `),e(t),e(`="`),e(n.escapeXML(typeof r==`string`?r:r.toString(10))),e(`"`))}this.children.length===0?e(`/>`):this._addChildren(e)}};r.prototype.tree=r.prototype.root,t.exports=r})),w=o(((e,t)=>{var n=C();function r(e,t){if(Array.isArray(t)){for(let n of t)r(e,n);return}t!==``&&t!=null&&t!==!0&&t!==!1&&e.cnode(t)}function i(e,t,...i){if(typeof t==`object`&&t){delete t.__source,delete t.__self;for(let[e,n]of Object.entries(t))n==null?delete t[e]:t[e]=n.toString(10)}let a=new n(e,t);for(let e of i)r(a,e);return a}t.exports=i})),T=o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),ee=o(((e,t)=>{var n=T(),r=S(),i=0,a=1,o=2,s=3,c=4,l=5,u=6,d=7,f=8,p=9,m=10;t.exports=class extends n.EventEmitter{constructor(){super();let e=i,t,n,h,g,_,v,y,b,x=0,S;this._handleTagOpening=function(e,t,n){e?this.emit(`endElement`,t,!1):(this.emit(`startElement`,t,n),v&&this.emit(`endElement`,t,!0))},this.write=function(C){typeof C!=`string`&&(C=C.toString());let w=0;t&&=(C=t+C,w+=n?0:t.length,n=!1,null);function T(){if(typeof x==`number`){let e=C.slice(x,w);return x=void 0,e}}for(;w<C.length;w++){switch(e){case i:{let e=C.indexOf(`<`,w);e!==-1&&w!==e&&(w=e);break}case f:{let e=C.indexOf(b,w);e!==-1&&(w=e);break}case a:{let e=C.indexOf(`-->`,w);e!==-1&&(w=e+2);break}case m:{let e=C.indexOf(`]]>`,w);e!==-1&&(w=e+2);break}}let t=C.charCodeAt(w);switch(e){case i:if(t===60){let t=T();t&&this.emit(`text`,r.unescapeXML(t)),e=s,x=w+1,g={}}break;case p:if(t===93){if(C.substr(w+1,2)===`]>`){let t=T();t&&this.emit(`text`,t),e=i}else C.length<w+2&&(n=!0,w=C.length)}break;case s:t===47&&x===w?(x=w+1,_=!0):t===33?C.substr(w+1,7)===`[CDATA[`?(x=w+8,e=p):C.length<w+8&&`[CDATA[`.startsWith(C.slice(w+1))?(n=!0,w=C.length):(x=void 0,e=a):t===63?(x=void 0,e=o):(t<=32||t===47||t===62)&&(h=T(),w--,e=c);break;case a:if(t===62){let t=C.charCodeAt(w-1),n=C.charCodeAt(w-2);(t===45&&n===45||t===93&&n===93)&&(e=i)}break;case o:t===62&&C.charCodeAt(w-1)===63&&(e=i);break;case c:t===62?(this._handleTagOpening(_,h,g),h=void 0,g=void 0,_=void 0,v=void 0,e=i,x=w+1):t===47?v=!0:t>32&&(x=w,e=l);break;case l:(t<=32||t===61)&&(S=T(),w--,e=u);break;case u:t===61&&(e=d);break;case d:(t===34||t===39)&&(y=t,b=t===34?`"`:`'`,e=f,x=w+1);break;case f:if(t===y){let t=r.unescapeXML(T());g[S]=t,S=void 0,e=c}}}typeof x==`number`&&x<=C.length&&(t=C.slice(x),x=0)}}end(e){e&&this.write(e),this.write=function(){}}}})),te=S(),ne=c(C(),1),re=c(w(),1),ie=T(),ae=c(ee(),1),oe=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}};function se(e){let t,n=new Promise(n=>{t=setTimeout(n,e)});return n.timeout=t,n}function E(e,t){let n=se(t);function r(){clearTimeout(n.timeout)}let i=new oe;return Promise.race([e.finally(r),n.then(()=>{throw i})])}var ce=new WeakMap;function le(e){let t=ce.get(e);return t||(t={on:(e.addEventListener??e.addListener).bind(e),off:(e.removeEventListener??e.removeListener).bind(e),once:(e.once??((t,n)=>e.addEventListener(t,n,{once:!0}))).bind(e)},ce.set(e,t)),t}function ue(e,t,n=`error`,r){return new Promise((i,a)=>{let o,{off:s,once:c}=le(e),l=()=>{clearTimeout(o),s(t,d),s(n,u)};function u(e){a(e),l()}function d(e){i(e),l()}if(c(t,d),n&&c(n,u),r){let e=new oe;o=setTimeout(()=>{l(),a(e)},r)}})}function de(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}function D(e,t=null,n){return new Promise((r,i)=>{function a(t){e.removeListener(`nonza`,s),i(t)}function o(...t){e.removeListener(`nonza`,s),r(...t)}async function s(e){try{await n(e,o)}catch(e){a(e)}}t&&e.send(t).catch(a),e.on(`nonza`,s)})}function fe(e){return{subscribe(t){let{on:n}=le(t);for(let[t,r]of Object.entries(e))n(t,r)},unsubscribe(t){let{off:n}=le(t);for(let[t,r]of Object.entries(e))n(t,r)}}}var pe=class extends Error{constructor(...e){super(...e),this.name=`XMLError`}},me=class extends ie.EventEmitter{constructor(){super();let e=new ae.default;this.root=null,this.cursor=null,e.on(`startElement`,this.onStartElement.bind(this)),e.on(`endElement`,this.onEndElement.bind(this)),e.on(`text`,this.onText.bind(this)),this.parser=e}onStartElement(e,t){let n=new ne.default(e,t),{root:r,cursor:i}=this;r?i!==r&&i.append(n):(this.root=n,this.emit(`start`,n)),this.cursor=n}onEndElement(e){let{root:t,cursor:n}=this;if(e!==n.name){this.emit(`error`,new pe(`${n.name} must be closed.`));return}if(n===t){this.emit(`end`,t);return}if(!n.parent){n.parent=t,this.emit(`element`,n),this.cursor=t;return}this.cursor=n.parent}onText(e){let{cursor:t}=this;if(!t){this.emit(`error`,new pe(`${e} must be a child.`));return}t.t(e)}write(e){this.parser.write(e)}end(e){e&&this.parser.write(e)}};me.XMLError=pe;function O(...e){return(0,re.default)(...e)}Object.assign(O,{Element:ne.default,createElement:re.default,Parser:me,escapeXML:te.escapeXML,unescapeXML:te.unescapeXML,escapeXMLText:te.escapeXMLText,unescapeXMLText:te.unescapeXMLText,XMLError:pe,xml:O});function he(e){return!(!e||e.replaceAll(String.raw`\20`,``).replaceAll(String.raw`\22`,``).replaceAll(String.raw`\26`,``).replaceAll(String.raw`\27`,``).replaceAll(String.raw`\2f`,``).replaceAll(String.raw`\3a`,``).replaceAll(String.raw`\3c`,``).replaceAll(String.raw`\3e`,``).replaceAll(String.raw`\40`,``).replaceAll(String.raw`\5c`,``).search(/[ "&'/:<>@\\]/g)===-1)}function ge(e){return e===null?null:e.replaceAll(/^\s+|\s+$/g,``).replaceAll(`\\`,String.raw`\5c`).replaceAll(` `,String.raw`\20`).replaceAll(`"`,String.raw`\22`).replaceAll(`&`,String.raw`\26`).replaceAll(`'`,String.raw`\27`).replaceAll(`/`,String.raw`\2f`).replaceAll(`:`,String.raw`\3a`).replaceAll(`<`,String.raw`\3c`).replaceAll(`>`,String.raw`\3e`).replaceAll(`@`,String.raw`\40`)}function _e(e){return e===null?null:e.replaceAll(String.raw`\20`,` `).replaceAll(String.raw`\22`,`"`).replaceAll(String.raw`\26`,`&`).replaceAll(String.raw`\27`,`'`).replaceAll(String.raw`\2f`,`/`).replaceAll(String.raw`\3a`,`:`).replaceAll(String.raw`\3c`,`<`).replaceAll(String.raw`\3e`,`>`).replaceAll(String.raw`\40`,`@`).replaceAll(String.raw`\5c`,`\\`)}var k=class e{constructor(e,t,n){if(typeof t!=`string`||!t)throw TypeError(`Invalid domain.`);this.setDomain(t),this.setLocal(typeof e==`string`?e:``),this.setResource(typeof n==`string`?n:``)}[Symbol.toPrimitive](e){return e===`number`?NaN:this.toString()}toString(e){let t=this._domain;return this._local&&(t=this.getLocal(e)+`@`+t),this._resource&&(t=t+`/`+this._resource),t}bare(){return this._resource?new e(this._local,this._domain,null):this}equals(e){return this._local===e._local&&this._domain===e._domain&&this._resource===e._resource}setLocal(e,t){return t||=he(e),t&&(e=ge(e)),this._local=e&&e.toLowerCase(),this}getLocal(e=!1){let t=null;return t=e?_e(this._local):this._local,t}setDomain(e){return this._domain=e.toLowerCase(),this}getDomain(){return this._domain}setResource(e){return this._resource=e,this}getResource(){return this._resource}};Object.defineProperty(k.prototype,"local",{get:k.prototype.getLocal,set:k.prototype.setLocal}),Object.defineProperty(k.prototype,"domain",{get:k.prototype.getDomain,set:k.prototype.setDomain}),Object.defineProperty(k.prototype,"resource",{get:k.prototype.getResource,set:k.prototype.setResource});function ve(e){let t,n,r=e.indexOf(`/`);r!==-1&&(n=e.slice(r+1),e=e.slice(0,r));let i=e.indexOf(`@`);return i!==-1&&(t=e.slice(0,i),e=e.slice(i+1)),new k(t,e,n)}function ye(e,t){return e.equals(t)}function be(...e){return!e[1]&&!e[2]?ve(...e):new k(...e)}var xe=be.bind();xe.jid=be,xe.JID=k,xe.parse=ve,xe.equal=ye,xe.detectEscape=he,xe.escapeLocal=ge,xe.unescapeLocal=_e;var Se=class extends Error{constructor(e,t,n){super(e+(t?` - ${t}`:``)),this.name=`XMPPError`,this.condition=e,this.text=t,this.application=n}static fromElement(e){let[t,n,r]=e.getChildElements(),i,a;n&&(n.is(`text`)?i=n:n&&(a=n),r&&(a=r));let o=new this(t.name,i?i.text():``,a);return o.element=e,o}},Ce=class extends Se{constructor(...e){super(...e),this.name=`StreamError`}};function we(e){let{port:t,hostname:n,protocol:r}=new URL(e);return n===`[::1]`&&(n=`::1`),{port:t,hostname:n,protocol:r}}function Te(e){let{port:t,hostname:n}=we(`http://${e}`);return{port:t,hostname:n}}function Ee(e){return e.includes(`://`)?we(e):Te(e)}var De=`urn:ietf:params:xml:ns:xmpp-streams`,Oe=`http://etherx.jabber.org/streams`,ke=class extends ie.EventEmitter{#e=null;#t=null;constructor(e={}){super(),typeof e==`string`&&(e={domain:e}),this.jid=null,this.timeout=e.timeout||2e3,this.options=e,this.status=`offline`,this.socket=null,this.parser=null,this.root=null}isSecure(){return this.socket?.secure===!0}async _streamError(e,t){try{await this.send(O(`stream:error`,{},[O(e,{xmlns:De},t)]))}catch{}return this.disconnect()}_onData(e){let t=e.toString(`utf8`);this.parser.write(t)}#n(e){this._streamError(`bad-format`),this._detachParser(),this.emit(`error`,e)}#r(e,t){this._detachSocket(),this._status(`disconnect`,{clean:!e,reason:t})}#i(e,t){this._detachParser(),this._status(`close`,{clean:!e,reason:t})}_attachSocket(e){this.socket=e,this.#e??=fe({data:this._onData.bind(this),close:this.#r.bind(this),connect:()=>this._status(`connect`),error:e=>this.emit(`error`,e)}),this.#e.subscribe(this.socket)}_detachSocket(){this.socket&&this.#e?.unsubscribe(this.socket),this.socket=null}_onElement(e){let t=e.is(`error`,Oe);t&&this._onStreamError(e),this.emit(`element`,e),this.emit(this.isStanza(e)?`stanza`:`nonza`,e),t&&this.disconnect()}_onStreamError(e){let t=Ce.fromElement(e);if(t.condition===`see-other-host`)return this._onSeeOtherHost(t);this.emit(`error`,t)}async _onSeeOtherHost(e){let{protocol:t}=Ee(this.options.service),n=e.element.getChildText(`see-other-host`),{port:r}=Te(n),i;i=r?`${t||`xmpp:`}//${n}`:(t?`${t}//`:``)+n;try{await ue(this,`disconnect`);let{domain:e,lang:t}=this.options;await this.connect(i),await this.open({domain:e,lang:t})}catch(e){this.emit(`error`,e)}}_attachParser(e){this.parser=e,this.#t??=fe({element:this._onElement.bind(this),error:this.#n.bind(this),end:this.#i.bind(this),start:e=>this._status(`open`,e)}),this.#t.subscribe(this.parser)}_detachParser(){this.parser&&this.#t?.unsubscribe(this.parser),this.parser=null,this.root=null}_jid(e){return this.jid=xe(e),this.jid}_status(e,...t){this.status!==e&&(this.status=e,this.emit(`status`,e,...t),this.emit(e,...t))}_ready(e=!1){e?this.status=`online`:this._status(`online`,this.jid)}async disconnect(){let e;try{e=await this._closeStream()}catch(e){this.#i(e)}try{await this._closeSocket()}catch(e){this.#r(!0,e)}return e}async start(){if(this.status!==`offline`)throw Error(`Connection is not offline`);let{service:e,domain:t,lang:n}=this.options;await this.connect(e);let r=ue(this,`online`);return await this.open({domain:t,lang:n}),r}async connect(e){this._status(`connecting`,e);let t=new this.Socket;return this._attachSocket(t),t.connect(this.socketParameters(e)),ue(t,`connect`)}async _closeSocket(e=this.timeout){this._status(`disconnecting`),this.socket.end(),await ue(this.socket,`close`,`error`,e)}async open(e){this._status(`opening`);let{domain:t,lang:n}=e,r=this.headerElement();return r.attrs.to=t,r.attrs[`xml:lang`]=n,this.root=r,this._attachParser(new this.Parser),await this.write(this.header(r)),ue(this,`open`,`error`,this.timeout)}async stop(){let e=await this.disconnect();return this._status(`offline`,e),e}async _closeStream(e=this.timeout){await this.#c(`close`);let t=this.footer(this.footerElement());return await this.write(t),this._status(`closing`),ue(this.parser,`end`,`error`,e)}async restart(){this._detachParser();let{domain:e,lang:t}=this.options;return this.open({domain:e,lang:t})}async send(e){e.parent=this.root,await this.write(e.toString()),this.emit(`send`,e)}sendReceive(e,t=this.timeout){return Promise.all([this.send(e),ue(this,`element`,`error`,t)]).then(([,e])=>e)}async write(e){if(this.status===`closing`)throw Error(`Connection is closing`);return new Promise((t,n)=>{this.socket.write(e,e=>e?n(e):t())})}isStanza(e){let{name:t}=e;return t===`iq`||t===`message`||t===`presence`}isNonza(e){return!this.isStanza(e)}header(e){return e.toString()}headerElement(){return new O.Element(``,{version:`1.0`,xmlns:this.NS})}footer(e){return e.toString()}footerElement(){}socketParameters(){}#a=new Map;#o=new Set([`close`]);hook(e,t){this.#s(e),this.#a.has(e)||this.#a.set(e,new Set),this.#a.get(e).add([t])}#s(e){if(!this.#o.has(e))throw Error(`Hook event name "${e}" is unknown.`)}unhook(e,t){this.#s(e);let n=this.#a.get(`event`),r=[...n].find(e=>e.handler===t);n.remove(r)}async#c(e,...t){this.#s(e);let n=this.#a.get(e);n&&await Promise.all([...n].map(async([e])=>{try{await e(...t)}catch(e){this.emit(`error`,e)}}))}};ke.prototype.NS=``,ke.prototype.Socket=null,ke.prototype.Parser=null;var Ae=class extends ke{constructor(e){super(e),this.transports=[]}send(e,...t){return this.Transport.prototype.send.call(this,e,...t)}sendMany(...e){return this.Transport.prototype.sendMany.call(this,...e)}_findTransport(e){return this.transports.find(t=>{try{return t.prototype.socketParameters(e)!==void 0}catch{return!1}})}connect(e){let t=this._findTransport(e);if(!t)throw Error(`No compatible connection method found.`);return this.Transport=t,this.Socket=t.prototype.Socket,this.Parser=t.prototype.Parser,super.connect(e)}socketParameters(...e){return this.Transport.prototype.socketParameters(...e)}header(e,...t){let n=this.isSecure()&&this.jid?.bare().toString();return n&&(e.attrs.from=n),this.Transport.prototype.header(e,...t)}headerElement(...e){return this.Transport.prototype.headerElement(...e)}footer(...e){return this.Transport.prototype.footer(...e)}footerElement(...e){return this.Transport.prototype.footerElement(...e)}};Ae.prototype.NS=`jabber:client`;var je=class extends ie.EventEmitter{constructor(e){super(),this.delay=1e3,this.entity=e,this._timeout=null}#e=()=>{this.scheduleReconnect()};scheduleReconnect(){let{entity:e,delay:t,_timeout:n}=this;clearTimeout(n),this._timeout=setTimeout(async()=>{if(e.status===`disconnect`)try{await this.reconnect()}catch{}},t)}async reconnect(){let{entity:e}=this;this.emit(`reconnecting`);let{service:t,domain:n,lang:r}=e.options;await e.connect(t),await e.open({domain:n,lang:r}),this.emit(`reconnected`)}start(){let{entity:e}=this;e.on(`disconnect`,this.#e)}stop(){let{entity:e,_timeout:t}=this;e.removeListener(`disconnect`,this.#e),clearTimeout(t)}};function Me({entity:e}){let t=new je(e);return t.start(),t}var Ne=`ECONNERROR`;function Pe(e){let t=we(e);return!!(t.protocol===`wss:`||[`localhost`,`127.0.0.1`,`::1`].includes(t.hostname))}var Fe=class extends ie.EventEmitter{#e=null;socket=null;url=null;secure=!1;connect(e){this.url=e,this.secure=Pe(e),this._attachSocket(new WebSocket(e,[`xmpp`]))}_attachSocket(e){this.socket=e,this.#e??=fe({open:()=>this.emit(`connect`),message:({data:e})=>this.emit(`data`,e),error:e=>{let{url:t}=this,{error:n}=e;n||(n=Error(e.message||`WebSocket ${Ne} ${t}`),n.errno=Ne,n.code=Ne),n.event=e,n.url=t,this.emit(`error`,n)},close:e=>{this._detachSocket(),this.emit(`close`,!e.wasClean,e)}}),this.#e.subscribe(this.socket)}_detachSocket(){this.url=null,this.secure=!1,this.socket&&this.#e?.unsubscribe(this.socket),this.socket=null}end(){this.socket.close()}write(e,t){function n(e){t&&Promise.resolve().then(()=>t(e))}try{this.socket.send(e)}catch(e){n(e);return}n()}},Ie=class extends me{onStartElement(e,t){let n=new ne.default(e,t),{cursor:r}=this;r&&r.append(n),this.cursor=n}onEndElement(e){let{cursor:t}=this;if(e!==t.name){this.emit(`error`,new pe(`${t.name} must be closed.`));return}if(t.parent){this.cursor=t.parent;return}t.is(`open`,`urn:ietf:params:xml:ns:xmpp-framing`)?this.emit(`start`,t):t.is(`close`,`urn:ietf:params:xml:ns:xmpp-framing`)?this.emit(`end`,t):this.emit(`element`,t),this.cursor=null}},Le=`urn:ietf:params:xml:ns:xmpp-framing`,Re=class extends ke{send(e,...t){return e.attrs.xmlns??=this.NS,super.send(e,...t)}async sendMany(e){for(let t of e)t.attrs.xmlns??=this.NS,t.parent=this.root,this.socket.write(t.toString()),this.emit(`send`,t)}footerElement(){return new O.Element(`close`,{xmlns:Le})}headerElement(){let e=super.headerElement();return e.name=`open`,e.attrs.xmlns=Le,e}socketParameters(e){return/^wss?:\/\//.test(e)?e:void 0}};Re.prototype.Socket=Fe,Re.prototype.NS=`jabber:client`,Re.prototype.Parser=Ie;function ze({entity:e}){e.transports.push(Re)}var Be=o(((e,t)=>{t.exports={}})),Ve=o(((e,t)=>{t.exports=n;function n(e){if(!Array.isArray(e))throw TypeError(`Middleware stack must be an array!`);for(let t of e)if(typeof t!=`function`)throw TypeError(`Middleware must be composed of functions!`);return function(t,n){let r=-1;return i(0);function i(a){if(a<=r)return Promise.reject(Error(`next() called multiple times`));r=a;let o=e[a];if(a===e.length&&(o=n),!o)return Promise.resolve();try{return Promise.resolve(o(t,i.bind(null,a+1)))}catch(e){return Promise.reject(e)}}}}})),He=c(Be(),1),Ue=c(Ve(),1),We=class{constructor(e,t){this.stanza=t,this.entity=e;let{name:n,attrs:r}=t,{type:i,id:a}=r;this.name=n,this.id=a||``,this.type=n===`message`?i||`normal`:n===`presence`?i||`available`:i||``,this.from=null,this.to=null,this.local=``,this.domain=``,this.resource=``}},Ge=class extends We{constructor(e,t){super(e,t);let{jid:n}=e,{domain:r}=e.options??{},i=t.attrs.to||n?.toString(),a=t.attrs.from||r;i&&(this.to=new xe(i)),a&&(this.from=new xe(a),this.local=this.from.local,this.domain=this.from.domain,this.resource=this.from.resource)}},Ke=class extends We{constructor(e,t){super(e,t);let{jid:n}=e,{domain:r}=e.options??{},i=t.attrs.from||n?.toString(),a=t.attrs.to||r;i&&(this.from=new xe(i)),a&&(this.to=new xe(a),this.local=this.to.local,this.domain=this.to.domain,this.resource=this.to.resource)}};function qe(e,t,n){return r=>{let i=new n(e,r);return(0,Ue.default)(t)(i)}}function Je(e){return(t,n)=>{n().then(t=>t&&e.send(t)).catch(t=>e.emit(`error`,t))}}function Ye({entity:e}){let t=[Je(e)],n=[],r=qe(e,t,Ge),i=qe(e,n,Ke);return e.on(`element`,r),e.on(`send`,i),{use(e){return t.push(e),e},filter(e){return n.push(e),e}}}function Xe({middleware:e}){function t(t,n,r){return e.use((e,i)=>{let{stanza:a}=e;if(!a.is(`features`,`http://etherx.jabber.org/streams`))return i();let o=a.getChild(t,n);return o?r(e,i,o):i()})}return{use:t}}function Ze(){let e;for(;!e;)e=Math.random().toString(36).slice(2,12);return e}var Qe=class extends Se{constructor(e,t,n,r){super(e,t,n),this.type=r,this.name=`StanzaError`}static fromElement(e){let t=super.fromElement(e);return t.type=e.attrs.type,t}};function $e({name:e,type:t}){return!(e!==`iq`||t!==`error`&&t!==`result`)}var et=class{constructor({entity:e,middleware:t}){this.handlers=new Map,this.entity=e,this.middleware=t}start(){this.middleware.use(this._route.bind(this))}_route({type:e,name:t,id:n,stanza:r},i){if(!$e({name:t,type:e}))return i();let a=this.handlers.get(n);if(!a)return i();e===`error`?a.reject(Qe.fromElement(r.getChild(`error`))):a.resolve(r),this.handlers.delete(n)}async request(e,t=3e4){e.attrs.id||(e.attrs.id=Ze());let n=new de;this.handlers.set(e.attrs.id,n);try{await this.entity.send(e),await E(n.promise,t)}catch(t){throw this.handlers.delete(e.attrs.id),t}return n.promise}_childRequest(e,t,n,...r){let{name:i,attrs:{xmlns:a}}=t;return this.request(O(`iq`,{type:e,to:n},t),...r).then(e=>e.getChild(i,a))}async get(...e){return this._childRequest(`get`,...e)}async set(...e){return this._childRequest(`set`,...e)}};function tt(...e){let t=new et(...e);return t.start(),t}var nt=`urn:ietf:params:xml:ns:xmpp-stanzas`;function rt({name:e,type:t}){return e===`iq`&&t!==`error`&&t!==`result`}function it({type:e},t,n){return!(e!==`get`&&e!==`set`||t.length!==1||!n)}function at({stanza:e}){return O(`iq`,{to:e.attrs.from,from:e.attrs.to,id:e.attrs.id})}function ot(e,t){let n=at(e);return n.attrs.type=`result`,t&&n.append(t),n}function st(e,t,n){let r=at(e);return r.attrs.type=`error`,n&&r.append(n),r.append(t),r}function ct(e,t){return O(`error`,{type:e},O(t,nt))}function lt(e){return async function(t,n){if(!rt(t))return n();let{stanza:r}=t,i=r.getChildElements(),[a]=i;if(!it(t,i,a))return st(t,ct(`modify`,`bad-request`),a);t.element=a;let o;try{o=await n()}catch(t){e.emit(`error`,t),o=ct(`cancel`,`internal-server-error`)}return o||=ct(`cancel`,`service-unavailable`),o instanceof O.Element&&o.is(`error`)?st(t,o,a):ot(t,o instanceof O.Element?o:void 0)}}function ut(e,t,n,r){return(i,a)=>i.type!==e|!i.element||!i.element.is(n,t)?a():r(i,a)}function dt({middleware:e,entity:t}){return e.use(lt(t)),{get(t,n,r){e.use(ut(`get`,t,n,r))},set(t,n,r){e.use(ut(`set`,t,n,r))}}}var ft=[`ENOTFOUND`,`ENODATA`];function pt(e,t={}){return t.all=!0,new Promise((n,r)=>{He.default.lookup(e,t,(e,t)=>{if(e)return r(e);let i=[];for(let{family:e,address:n}of t){let t=`://${e===4?n:`[`+n+`]`}:`;i.push({family:e,address:n,uri:`xmpps`+t+`5223`},{family:e,address:n,uri:`xmpp`+t+`5222`})}n(i)})})}function mt(e,{service:t,protocol:n}){return new Promise((r,i)=>{He.default.resolveSrv(`_${t}._${n}.${e}`,(e,a)=>{e&&ft.includes(e.code)?r([]):e?i(e):r(a.map(e=>Object.assign(e,{service:t,protocol:n})))})})}function ht(e){return e.toSorted((e,t)=>{let n=e.priority-t.priority;if(n!==0)return n;let r=t.weight-e.weight;return r===0?0:r})}function gt(e,t){let n=[];return Promise.all(e.map(async e=>{let r=await pt(e.name,t);for(let t of r){let{port:r,service:i}=e,a=t.address;n.push({...t,...e,uri:`${i.split(`-`)[0]}://${t.family===6?`[`+a+`]`:a}:${r}`})}})).then(()=>n)}function _t(e,t={}){t.srv||=[{service:`xmpps-client`,protocol:`tcp`},{service:`xmpp-client`,protocol:`tcp`},{service:`xmpps-server`,protocol:`tcp`},{service:`xmpp-server`,protocol:`tcp`},{service:`stun`,protocol:`tcp`},{service:`stun`,protocol:`udp`},{service:`stuns `,protcol:`tcp`},{service:`turn`,protocol:`tcp`},{service:`turn`,protocol:`udp`},{service:`turns`,protcol:`tcp`}];let n={options:t};return pt(e,t).then(r=>Promise.all(t.srv.map(r=>mt(e,{...r,family:n}).then(e=>gt(e,t)))).then(e=>[...ht(e.flat()),...r]))}function vt(e){let t=new me,n=null,r=null;if(t.on(`start`,e=>{n=e}),t.on(`element`,e=>{n.append(e)}),t.on(`error`,e=>{r=e}),t.write(e),t.end(),r)throw r;return n}function yt(e){return e.startsWith(`https`)||e.startsWith(`wss`)}function bt(e,t){let n;if(n=yt(e.uri)&&!yt(t.uri)?-1:!yt(e.uri)&&yt(t.uri)?1:0,n!==0)return n;let r;return r=e.method===t.method?0:e.method===`websocket`?-1:t.method===`websocket`?1:e.method===`xbosh`?-1:t.method===`xbosh`?1:e.method===`httppoll`?-1:+(t.method===`httppoll`),r===0?0:r}function xt(e){return fetch(`https://${e}/.well-known/host-meta`).then(e=>e.text()).then(e=>vt(e).getChildren(`Link`).filter(e=>[`urn:xmpp:alt-connections:websocket`,`urn:xmpp:alt-connections:httppoll`,`urn:xmpp:alt-connections:xbosh`].includes(e.attrs.rel)).map(({attrs:e})=>({rel:e.rel,href:e.href,method:e.rel.split(`:`).pop(),uri:e.href})).toSorted(bt)).catch(()=>[])}function St(...e){return Promise.all([_t?_t(...e):Promise.resolve([]),xt(...e)]).then(([e,t])=>[...e,...t])}async function Ct(e){let t=await St(e,{srv:[{service:`xmpps-client`,protocol:`tcp`},{service:`xmpp-client`,protocol:`tcp`}]});return[...new Set(t.map(e=>e.uri))]}function wt(e,t){return t.filter(t=>e._findTransport(t))}async function Tt(e,t){if(t.length===0)throw Error(`Couldn't connect`);let n=t.shift(),r=e._findTransport(n);if(!r)return Tt(e,t);e._status(`connecting`,n);let i=r.prototype.socketParameters(n),a=new r.prototype.Socket;try{a.connect(i),await ue(a,`connect`)}catch{return Tt(e,t)}e._attachSocket(a),a.emit(`connect`),e.Transport=r,e.Socket=r.prototype.Socket,e.Parser=r.prototype.Parser}function A({entity:e}){let t=e.connect;e.connect=async function(n){if(!n||/:\/\//.test(n))return t.call(this,n);let r=wt(e,await Ct(n));if(r.length===0)throw Error(`No compatible transport found.`);try{await Tt(e,r)}catch(t){throw await e.disconnect(),e._status(`disconnect`),t}}}function Et(e){return globalThis.btoa(e)}function Dt(e){return globalThis.atob(e)}var Ot=class extends Se{constructor(...e){super(...e),this.name=`SASLError`}},kt=`urn:ietf:params:xml:ns:xmpp-sasl`;function At(e,t,n){let r=new Set(e.getChildren(`mechanism`,t).map(e=>e.text()));return n._mechs.map(({name:e})=>e).filter(e=>r.has(e))}async function jt({saslFactory:e,entity:t,mechanism:n,credentials:r}){let i=e.create([n]);if(!i)throw Error(`SASL: Mechanism ${n} not found.`);let{domain:a}=t.options,o={username:null,password:null,server:a,host:a,realm:a,serviceType:`xmpp`,serviceName:a,...r};await D(t,i.clientFirst&&O(`auth`,{xmlns:kt,mechanism:i.name},Et(await i.response(o))),async(e,n)=>{if(e.getNS()===kt){if(e.name===`challenge`){await i.challenge(Dt(e.text()));let n=await i.response(o);await t.send(O(`response`,{xmlns:kt,mechanism:i.name},typeof n==`string`?Et(n):``));return}if(e.name===`failure`)throw Ot.fromElement(e);if(e.name===`success`)return n()}})}function Mt({streamFeatures:e,saslFactory:t},n){e.use(`mechanisms`,kt,async({entity:e},r,i)=>{let a=At(i,kt,t);if(a.length===0)throw new Ot(`SASL: No compatible mechanism available.`);async function o(n,r){await jt({saslFactory:t,entity:e,mechanism:r,credentials:n})}await n(o,a,null,e),await e.restart()})}var Nt=`urn:xmpp:sasl:2`;async function Pt({saslFactory:e,entity:t,mechanism:n,credentials:r,userAgent:i,streamFeatures:a,features:o}){let s=e.create([n]);if(!s)throw Error(`SASL: Mechanism ${n} not found.`);let{domain:c}=t.options,l={username:null,password:null,server:c,host:c,realm:c,serviceType:`xmpp`,serviceName:c,...r};await D(t,O(`authenticate`,{xmlns:Nt,mechanism:s.name},[s.clientFirst&&O(`initial-response`,{},Et(await s.response(l))),i,...a]),async(e,n)=>{if(e.getNS()===Nt){if(e.name===`challenge`){await s.challenge(Dt(e.text()));let n=await s.response(l);await t.send(O(`response`,{xmlns:Nt,mechanism:s.name},typeof n==`string`?Et(n):``));return}if(e.name===`failure`)throw Ot.fromElement(e);if(e.name===`continue`)throw Error(`SASL continue is not supported yet`);if(e.name===`success`){let r=e.getChild(`additional-data`)?.text();r&&s.final&&await s.final(Dt(r));let i=e.getChildText(`authorization-identifier`);i&&t._jid(i);for(let t of e.getChildElements())o.get(t.getNS())?.[1]?.(t);return n()}}})}function Ft({streamFeatures:e,saslFactory:t},n){let r=new Map,i;return e.use(`authentication`,Nt,async({entity:e},a,o)=>{let s=At(o,Nt,t),c=await It({element:o,features:r}),l=!!i?.mechanism;if(s.length===0&&!l)throw new Ot(`SASL: No compatible mechanism available.`);await n(u,s,l?i:null,e);async function u(n,a,o){await i.auth({authenticate:Pt,entity:e,userAgent:o,streamFeatures:c,features:r,credentials:n})||await Pt({entity:e,userAgent:o,streamFeatures:c,features:r,saslFactory:t,mechanism:a,credentials:n})}}),{use(e,t,n){r.set(e,[t,n])},setup({fast:e}){i=e}}}async function It({element:e,features:t}){let n=[],r=e.getChild(`inline`);if(!r)return n;for(let e of r.getChildElements()){let r=e.getNS(),i=t.get(r);i&&n.push(i[0](e))}return Promise.all(n)}var Lt=`urn:ietf:params:xml:ns:xmpp-bind`;function Rt(e){return O(`bind`,{xmlns:Lt},e&&O(`resource`,{},e))}async function zt(e,t,n){let r=(await t.set(Rt(n))).getChildText(`jid`);return e._jid(r),e._ready(!1),r}function Bt({iqCaller:e},t){return async({entity:n},r)=>{t=typeof t==`function`?await t():t,await zt(n,e,t),r()}}function Vt({streamFeatures:e,iqCaller:t},n){e.use(`bind`,Lt,Bt({iqCaller:t},n))}function Ht(e=new Date){return typeof e==`string`&&(e=new Date(e)),new Date(e).toISOString().split(`.`)[0]+`Z`}function Ut({bind2:e,sm:t,failed:n,enabled:r}){e.use(Jt,e=>Yt({sm:t}),async e=>{e.is(`enabled`)?r(e.attrs):e.is(`failed`)&&n()})}function Wt({sasl2:e,sm:t,failed:n,resumed:r}){e.use(Jt,e=>{if(e.is(`sm`)&&t.id)return Xt({sm:t})},e=>{e.is(`resumed`)?r(e):e.is(`failed`)&&n()})}function Gt({streamFeatures:e,sm:t,entity:n,resumed:r,failed:i,enabled:a}){e.use(`sm`,Jt,async(e,o)=>{if(t.id)try{await r(await qt(n,t));return}catch{i()}await o();let s=Kt(n,t);if(t.outbound_q.length>0)throw Error(`Stream Management assertion failure, queue should be empty after enable`);t.outbound=0;try{a((await s).attrs)}catch{t.enabled=!1,t.enableSent=!1}})}function Kt(e,t){return D(e,Yt({sm:t}),(e,t)=>{if(e.is(`enabled`,`urn:xmpp:sm:3`))return t(e);if(e.is(`failed`,`urn:xmpp:sm:3`))throw Se.fromElement(e)})}async function qt(e,t){return D(e,Xt({sm:t}),(e,t)=>{if(e.is(`resumed`,`urn:xmpp:sm:3`))return t(e);if(e.is(`failed`,`urn:xmpp:sm:3`))throw Se.fromElement(e)})}var Jt=`urn:xmpp:sm:3`;function Yt({sm:e}){return O(`enable`,{xmlns:Jt,max:e.preferredMaximum,resume:`true`})}function Xt({sm:e}){return O(`resume`,{xmlns:Jt,h:e.inbound,previd:e.id})}function j({streamFeatures:e,entity:t,middleware:n,bind2:r,sasl2:i}){let a=null,o=null,s=null,c=new ie.EventEmitter;Object.assign(c,{preferredMaximum:null,enabled:!1,enableSent:!1,id:``,outbound_q:[],outbound:0,inbound:0,max:null,timeout:6e4,requestAckInterval:3e4,requestAckDebounce:250});async function l(){try{await t.send(O(`a`,{xmlns:Jt,h:c.inbound}))}catch{}}t.on(`disconnect`,()=>{clearTimeout(a),clearTimeout(o),clearTimeout(s),c.enabled=!1,c.enableSent=!1}),t.hook(`close`,async()=>{c.enabled&&await l()});async function u(e){c.enabled=!0,f(+e.attrs.h);let n=c.outbound_q;c.outbound_q=[],await t.sendMany(n.map(e=>Zt({entity:t,item:e}))),c.emit(`resumed`),t._ready(!0),h()}function d(){c.enabled=!1,c.enableSent=!1,c.id=``,p()}function f(e){let t=c.outbound;for(let n=0;n<+e-t;n++){let e=c.outbound_q.shift();c.outbound++,c.emit(`ack`,e.stanza)}}function p(){let e;for(;e=c.outbound_q.shift();)c.emit(`fail`,e.stanza);c.outbound=0}function m({id:e,max:t}){c.enabled=!0,c.id=e,c.max=t,c.inbound=0,h()}t.on(`offline`,()=>{p(),c.inbound=0,c.enabled=!1,c.enableSent=!1,c.id=``}),n.use(async(e,t)=>{let{stanza:n}=e;return clearTimeout(a),a=null,[`presence`,`message`,`iq`].includes(n.name)?c.inbound+=1:n.is(`r`,`urn:xmpp:sm:3`)?await l():n.is(`a`,`urn:xmpp:sm:3`)&&f(+n.attrs.h),h(),t()}),r&&Ut({bind2:r,sm:c,failed:d,enabled:m}),i&&Wt({sasl2:i,sm:c,failed:d,resumed:u});function h(e=c.requestAckInterval){clearTimeout(o),c.enabled&&e&&(o=setTimeout(g,e))}function g(){clearTimeout(o),clearTimeout(s),c.enabled&&(c.timeout&&!a&&(a=setTimeout(()=>{clearTimeout(o),t.disconnect().catch(()=>{})},c.timeout)),t.send(O(`r`,{xmlns:Jt})).catch(()=>{}),h())}return n.filter((e,t)=>{let{stanza:n}=e;return n.is(`enable`,`urn:xmpp:sm:3`)&&(c.enableSent=!0),!c.enabled&&!c.enableSent||![`presence`,`message`,`iq`].includes(n.name)?t():(c.outbound_q.push({stanza:n,stamp:Ht()}),clearTimeout(o),clearTimeout(s),s=setTimeout(g,c.requestAckDebounce),t())}),e&&Gt({streamFeatures:e,sm:c,entity:t,resumed:u,failed:d,enabled:m}),c}function Zt({entity:e,item:t}){let{stanza:n,stamp:r}=t;return n.name===`message`&&!n.getChild(`delay`,`urn:xmpp:delay`)&&n.append(O(`delay`,{xmlns:`urn:xmpp:delay`,from:e.jid.toString(),stamp:r})),n}var Qt=`urn:xmpp:bind:0`;function $t({sasl2:e,entity:t},n){let r=new Map;return e.use(Qt,async e=>{if(!e.is(`bind`,Qt))return;n=typeof n==`function`?await n():n;let t=await en({element:e,features:r});return O(`bind`,{xmlns:`urn:xmpp:bind:0`},n&&O(`tag`,null,n),...t)},e=>{if(e.is(`bound`)){t._ready(!1);for(let t of e.getChildElements())r.get(t.getNS())?.[1]?.(t)}}),{use(e,t,n){r.set(e,[t,n])}}}function en({element:e,features:t}){let n=[],r=e.getChild(`inline`);if(!r)return n;for(let e of r.getChildElements()){let r=e.attrs.var,i=t.get(r);i&&n.push(i[0](e))}return Promise.all(n)}var tn=o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t):typeof define==`function`&&define.amd&&define([`exports`,`module`],r)})(e,function(e,t){function n(){this._mechs=[]}n.prototype.use=function(e,t){return t||(t=e,e=t.prototype.name),this._mechs.push({name:e,mech:t}),this},n.prototype.create=function(e){for(var t=0,n=this._mechs.length;t<n;t++)for(var r=0,i=e.length;r<i;r++){var a=this._mechs[t];if(a.name==e[r])return new a.mech}return null},e=t.exports=n})})),nn=c(o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t,tn()):typeof define==`function`&&define.amd&&define([`exports`,`module`,`./lib/factory`],r)})(e,function(e,t,n){e=t.exports=n,e.Factory=n})}))(),1),rn=`urn:xmpp:fast:0`;function an({sasl2:e,entity:t}){let n=new nn.default,r,i=new ie.EventEmitter;Object.assign(i,{mechanism:null,mechanisms:[],async saveToken(e){r=e},async fetchToken(){return r},async deleteToken(){r=null},async save(e){try{await this.saveToken(e)}catch(e){t.emit(`error`,e)}},async fetch(){try{return this.fetchToken()}catch(e){t.emit(`error`,e)}},async delete(){try{await this.deleteToken()}catch(e){t.emit(`error`,e)}},saslFactory:n,async auth({authenticate:e,entity:t,userAgent:n,credentials:r,streamFeatures:o,features:s}){if(!i.mechanism)return!1;let{token:c}=r;if(!on(c,i.mechanisms))return l();try{return await e({saslFactory:i.saslFactory,mechanism:c.mechanism,credentials:{...r,password:c.token},streamFeatures:[...o,O(`fast`,{xmlns:rn})],entity:t,userAgent:n,features:s}),!0}catch(e){return e instanceof Ot&&[`not-authorized`,`credentials-expired`].includes(e.condition)?l():(t.emit(`error`,e),!1)}async function l(){return await i.delete(),a(o),!1}}});function a(e){e.push(O(`request-token`,{xmlns:rn,mechanism:i.mechanism}))}function o(){i.mechanism=null,i.mechanisms=[]}return o(),e.use(rn,async e=>{if(!e.is(`fast`,rn))return o();i.available=!0;let t=At(e,rn,n),r=t[0];if(!r)return o();i.mechanisms=t,i.mechanism=r},async e=>{e.is(`token`,rn)&&await i.save({mechanism:i.mechanism,token:e.attrs.token,expiry:e.attrs.expiry})}),i}function on(e,t){return!(!e||!t.includes(e.mechanism)||new Date(e.expiry)<=new Date)}var sn=o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t):typeof define==`function`&&define.amd&&define([`exports`,`module`],r)})(e,function(e,t){function n(){}n.prototype.name=`PLAIN`,n.prototype.clientFirst=!0,n.prototype.response=function(e){var t=``;return t+=e.authzid||``,t+=`\0`,t+=e.username,t+=`\0`,t+=e.password,t},n.prototype.challenge=function(e){return this},e=t.exports=n})})),cn=c(o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t,sn()):typeof define==`function`&&define.amd&&define([`exports`,`module`,`./lib/mechanism`],r)})(e,function(e,t,n){e=t.exports=n,e.Mechanism=n})}))(),1);function ln(e){e.use(cn.default)}var un=o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t):typeof define==`function`&&define.amd&&define([`exports`,`module`],r)})(e,function(e,t){function n(){}n.prototype.name=`ANONYMOUS`,n.prototype.clientFirst=!0,n.prototype.response=function(e){return e.trace||``},n.prototype.challenge=function(e){},e=t.exports=n})})),dn=c(o(((e,t)=>{(function(n,r){typeof e==`object`?r(e,t,un()):typeof define==`function`&&define.amd&&define([`exports`,`module`,`./lib/mechanism`],r)})(e,function(e,t,n){e=t.exports=n,e.Mechanism=n})}))(),1);function fn(e){e.use(dn.default)}function pn(){}pn.prototype.Mechanism=pn,pn.prototype.name=`HT-SHA-256-NONE`,pn.prototype.clientFirst=!0,pn.prototype.response=async function({username:e,password:t}){this.key=await crypto.subtle.importKey(`raw`,new TextEncoder().encode(t),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`,`verify`]);let n=await crypto.subtle.sign(`HMAC`,this.key,new TextEncoder().encode(`Initiator`));return`${e}\0${String.fromCodePoint(...new Uint8Array(n))}`},pn.prototype.final=async function(e){let t=Uint8Array.from(e,e=>e.codePointAt(0));if(await crypto.subtle.verify(`HMAC`,this.key,t,new TextEncoder().encode(`Responder`))!==!0)throw Error(`Responder message from server was wrong`)};function mn(e){e.use(pn)}var hn=`ANONYMOUS`,gn=`PLAIN`;function _n(e,t){return async function(...n){if(typeof e==`function`){await e(...n);return}let[r,i,a,o]=n;e.token??=await a?.fetch(),await r(e,vn({mechanisms:i,entity:o,credentials:e}),t)}}function vn({mechanisms:e,entity:t,credentials:n}){return!n?.username&&!n?.password&&!n?.token&&e.includes(hn)?hn:t.isSecure()?e[0]:e.find(e=>e!==gn)}function yn(e){return(e.split(`://`)[1]||e).split(`:`)[0].split(`/`)[0]}function bn(e={}){let{resource:t,credentials:n,username:r,password:i,userAgent:a,...o}=e,{domain:s,service:c}=o;!s&&c&&(o.domain=yn(c));let l=new Ae(o);r&&o.domain&&(l.jid=xe(r,o.domain));let u=Me({entity:l}),d=ze({entity:l}),f=xn(He.default,{entity:l}),p=xn(He.default,{entity:l}),m=Ye({entity:l}),h=Xe({middleware:m}),g=tt({middleware:m,entity:l}),_=dt({middleware:m,entity:l}),v=A({entity:l}),y=new nn.default,b=Object.entries({...typeof He.default==`function`&&{scramsha1:He.default},plain:ln,anonymous:fn}).map(([e,t])=>({[e]:t(y)}));a??=O(`user-agent`,{id:globalThis.crypto.randomUUID()});let x=xn(He.default,{streamFeatures:h}),S=Ft({streamFeatures:h,saslFactory:y},_n(n??{username:r,password:i},a)),C=an({sasl2:S,entity:l});S.setup({fast:C});let w=$t({sasl2:S,entity:l},t);mn(C.saslFactory);let T=Mt({streamFeatures:h,saslFactory:y},_n(n??{username:r,password:i},a)),ee=j({streamFeatures:h,entity:l,middleware:m,bind2:w,sasl2:S}),te=Vt({iqCaller:g,streamFeatures:h},t);return _?.get(`urn:xmpp:ping`,`ping`,()=>({})),Object.assign(l,{entity:l,reconnect:u,tcp:f,websocket:d,tls:p,middleware:m,streamFeatures:h,iqCaller:g,iqCallee:_,resolve:v,starttls:x,saslFactory:y,sasl2:S,sasl:T,resourceBinding:te,streamManagement:ee,mechanisms:b,bind2:w,fast:C})}function xn(e,...t){if(typeof e==`function`)return e(...t)}var M={carbons:`urn:xmpp:carbons:2`,forward:`urn:xmpp:forward:0`,mam:`urn:xmpp:mam:2`,rsm:`http://jabber.org/protocol/rsm`,sid:`urn:xmpp:sid:0`,hints:`urn:xmpp:hints`,chatstates:`http://jabber.org/protocol/chatstates`,oob:`jabber:x:oob`,upload:`urn:xmpp:http:upload:0`,delay:`urn:xmpp:delay`,disco:`http://jabber.org/protocol/disco#items`,discoInfo:`http://jabber.org/protocol/disco#info`,push:`urn:xmpp:push:0`,hello:`urn:nethvoice:chat:presence`,data:`jabber:x:data`,muc:`http://jabber.org/protocol/muc`,mucOwner:`http://jabber.org/protocol/muc#owner`,mucAdmin:`http://jabber.org/protocol/muc#admin`,mucsub:`urn:xmpp:mucsub:0`,pubsubEvent:`http://jabber.org/protocol/pubsub#event`,mucsubMessages:`urn:xmpp:mucsub:nodes:messages`,mucsubConfig:`urn:xmpp:mucsub:nodes:config`,mucUser:`http://jabber.org/protocol/muc#user`,conference:`jabber:x:conference`,vcard:`vcard-temp`,ping:`urn:xmpp:ping`,reactions:`urn:xmpp:reactions:0`,reply:`urn:xmpp:reply:0`,fallback:`urn:xmpp:fallback:0`},Sn=3e4,Cn=class{xmpp;me;domain;mucHost;uploadService;mamQueries=new Map;mamReactions=new Map;stopped=!1;attempt=0;retryTimer;pingTimer;unauthorized=!1;connected=!1;online=new Map;cfg;h;constructor(e,t){this.cfg=e,this.h=t,this.domain=e.host,this.mucHost=`conference.${e.host}`,this.me=`${e.username}@${e.host}`,this.xmpp=bn({service:`wss://${e.host}/xmpp-websocket`,domain:e.host,username:e.username,password:e.token,resource:`chat-island.`+Math.random().toString(36).slice(2,8)}),this.xmpp.reconnect?.stop(),this.xmpp.on(`status`,e=>{this.stopped||this.unauthorized||((e===`connecting`||e===`opening`||e===`connect`)&&this.h.status(`connecting`),(e===`disconnect`||e===`close`)&&(this.connected=!1,window.clearInterval(this.pingTimer),this.forgetPresence(),this.h.status(`offline`)),e===`disconnect`&&this.scheduleRetry())}),this.xmpp.on(`error`,e=>{if(!this.stopped){if(Tn(e)){this.unauthorized=!0,window.clearTimeout(this.retryTimer),this.h.status(`unauthorized`,e.message);return}this.h.status(`error`,e.message)}}),this.xmpp.on(`online`,async()=>{if(this.stopped){await this.xmpp.stop().catch(()=>{});return}this.attempt=0,this.connected=!0;try{await this.xmpp.send(O(`iq`,{type:`set`,id:`carbons`},O(`enable`,{xmlns:M.carbons}))),await this.xmpp.send(O(`presence`))}catch{return}window.clearInterval(this.pingTimer),this.pingTimer=window.setInterval(()=>this.ping(),Sn),this.h.status(`online`)}),this.xmpp.on(`stanza`,e=>this.onStanza(e))}start(){window.addEventListener(`online`,this.wake),document.addEventListener(`visibilitychange`,this.onVisible),this.h.status(`connecting`),setTimeout(()=>this.connectNow(),0)}stop(){return this.stopped=!0,window.clearTimeout(this.retryTimer),window.clearInterval(this.pingTimer),window.removeEventListener(`online`,this.wake),document.removeEventListener(`visibilitychange`,this.onVisible),this.xmpp.stop().catch(()=>{})}wake=()=>{if(!(this.stopped||this.unauthorized)){if(this.connected){this.ping();return}window.clearTimeout(this.retryTimer),this.attempt=0,this.connectNow()}};onVisible=()=>{document.visibilityState===`visible`&&this.wake()};ping(){this.connected&&this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:this.domain},O(`ping`,{xmlns:M.ping})),1e4).catch(e=>{!this.stopped&&this.connected&&e.name!==`StanzaError`&&this.xmpp.disconnect().catch(()=>{})})}forgetPresence(){for(let e of this.online.keys())this.h.presence(e,!1);this.online.clear()}connectNow(){if(this.stopped||this.unauthorized)return;this.retryTimer=void 0;let e=this.xmpp;(e.status===`offline`?this.xmpp.start():e.connect(e.options.service).then(()=>e.open({domain:e.options.domain}))).catch(e=>{if(!this.stopped){if(Tn(e)){this.unauthorized=!0,this.h.status(`unauthorized`,e.message);return}this.h.status(`error`,e.message),this.scheduleRetry()}})}scheduleRetry(){if(this.stopped||this.unauthorized||this.retryTimer!==void 0)return;let e=Math.min(6e4,1e3*2**this.attempt)*(.7+Math.random()*.6);this.attempt++,this.retryTimer=window.setTimeout(()=>this.connectNow(),e)}isGroup(e){return e.endsWith(`@`+this.mucHost)}async send(e,t,n,r){let i=crypto.randomUUID(),a=this.isGroup(e),o=r?`> ${r.quote??``}\n`:``,s=[O(`body`,{},o+t),O(`origin-id`,{xmlns:M.sid,id:i}),O(`store`,{xmlns:M.hints})];return n&&s.push(O(`x`,{xmlns:M.oob},O(`url`,{},n))),r&&(s.push(O(`reply`,{xmlns:M.reply,id:r.id,to:a?`${e}/${r.author}`:`${r.author}@${this.domain}`})),s.push(O(`fallback`,{xmlns:M.fallback,for:M.reply},O(`body`,{start:`0`,end:String([...o].length)})))),a?(await this.xmpp.send(O(`message`,{to:e,type:`groupchat`,id:i},...s)),{id:i,oid:i,from:e,to:this.cfg.username,body:t,ts:Date.now(),mine:!0,oob:n,room:e,nick:this.cfg.username,reply:r}):(s.push(O(`active`,{xmlns:M.chatstates})),await this.xmpp.send(O(`message`,{to:`${e}@${this.domain}`,type:`chat`,id:i},...s)),{id:i,oid:i,from:this.cfg.username,to:e,body:t,ts:Date.now(),mine:!0,oob:n,reply:r})}async react(e,t,n){let r=this.isGroup(e),i=O(`reactions`,{xmlns:M.reactions,id:t},...n.map(e=>O(`reaction`,{},e)));await this.xmpp.send(O(`message`,{to:r?e:`${e}@${this.domain}`,type:r?`groupchat`:`chat`,id:crypto.randomUUID()},i,O(`store`,{xmlns:M.hints})))}async announce(e){for(let t of e)await this.xmpp.send(O(`presence`,{to:`${t}@${this.domain}`},O(`x`,{xmlns:M.hello}))).catch(()=>{})}typing(e,t){return this.isGroup(e)?Promise.resolve():this.xmpp.send(O(`message`,{to:`${e}@${this.domain}`,type:`chat`},O(t?`composing`:`paused`,{xmlns:M.chatstates})))}enablePush(e,t){return this.xmpp.iqCaller.request(O(`iq`,{type:`set`},O(`enable`,{xmlns:M.push,jid:e,node:t})),15e3)}disablePush(e,t){return this.xmpp.iqCaller.request(O(`iq`,{type:`set`},O(`disable`,{xmlns:M.push,jid:e,node:t})),5e3)}async recent(e=200){return this.mam(void 0,void 0,e)}history(e,t,n=30){return this.mam(e,t,n)}async mam(e,t,n){let r=crypto.randomUUID();this.mamQueries.set(r,[]),this.mamReactions.set(r,[]);let i=O(`set`,{xmlns:M.rsm},O(`max`,{},String(n)),O(`before`,{},t??``)),a=[O(`field`,{var:`FORM_TYPE`,type:`hidden`},O(`value`,{},M.mam))];e&&a.push(O(`field`,{var:`with`},O(`value`,{},this.isGroup(e)?e:`${e}@${this.domain}`)));let o=O(`x`,{xmlns:M.data,type:`submit`},...a),s,c,l;try{s=await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,id:r},O(`query`,{xmlns:M.mam,queryid:r},o,i)),3e4)}finally{c=this.mamQueries.get(r)??[],l=this.mamReactions.get(r)??[],this.mamQueries.delete(r),this.mamReactions.delete(r)}let u=s.getChild(`fin`,M.mam),d=u?.getChild(`set`,M.rsm)?.getChildText(`first`)??void 0;return{messages:c,reactions:l,complete:u?.attrs.complete===`true`,first:d}}async createGroup(e,t,n){let r=`g-${Math.random().toString(36).slice(2,10)}@${this.mucHost}`,i=this.cfg.username,a=this.waitFor(e=>e.is(`presence`)&&N(e.attrs.from)===r,1e4);await this.xmpp.send(O(`presence`,{to:`${r}/${i}`},O(`x`,{xmlns:M.muc}))),await a;let o=(e,t)=>O(`field`,{var:e},O(`value`,{},t));await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:r},O(`query`,{xmlns:M.mucOwner},O(`x`,{xmlns:M.data,type:`submit`},o(`FORM_TYPE`,`http://jabber.org/protocol/muc#roomconfig`),o(`muc#roomconfig_roomname`,e),o(`muc#roomconfig_persistentroom`,`1`),o(`muc#roomconfig_membersonly`,`1`),o(`muc#roomconfig_publicroom`,`0`),o(`muc#roomconfig_whois`,`anyone`),o(`allow_subscription`,`1`),o(`mam`,`1`)))),15e3),n&&await this.setGroupAvatar(r,n).catch(()=>{});let s=t.filter(e=>e&&e!==this.cfg.username);await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:r},O(`query`,{xmlns:M.mucAdmin},...s.map(e=>O(`item`,{affiliation:`member`,jid:`${e}@${this.domain}`})))),15e3);for(let e of s)await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:r},O(`subscribe`,{xmlns:M.mucsub,jid:`${e}@${this.domain}`,nick:e},O(`event`,{node:M.mucsubMessages}),O(`event`,{node:M.mucsubConfig}))),15e3).catch(()=>{});await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:r},O(`subscribe`,{xmlns:M.mucsub,nick:i},O(`event`,{node:M.mucsubMessages}),O(`event`,{node:M.mucsubConfig}))),15e3),await this.xmpp.send(O(`presence`,{to:`${r}/${i}`,type:`unavailable`}));for(let t of s)await this.xmpp.send(O(`message`,{to:`${t}@${this.domain}`},O(`x`,{xmlns:M.conference,jid:r,reason:e}))).catch(()=>{});return r}async leaveGroup(e,t){t?await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:e},O(`query`,{xmlns:M.mucOwner},O(`destroy`,{}))),1e4):await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:e},O(`unsubscribe`,{xmlns:M.mucsub})),1e4)}async setGroupAvatar(e,t){let n=/^data:(image\/[a-z+]+);base64,(.+)$/i.exec(t);n&&await this.xmpp.iqCaller.request(O(`iq`,{type:`set`,to:e},O(`vCard`,{xmlns:M.vcard},O(`PHOTO`,{},O(`TYPE`,{},n[1]),O(`BINVAL`,{},n[2])))),15e3)}async groupAvatar(e){let t=(await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:e},O(`vCard`,{xmlns:M.vcard})),1e4)).getChild(`vCard`,M.vcard)?.getChild(`PHOTO`),n=t?.getChildText(`BINVAL`);return n?`data:${t?.getChildText(`TYPE`)||`image/jpeg`};base64,${n.replace(/\s+/g,``)}`:void 0}async listGroups(){let e=((await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:this.mucHost},O(`subscriptions`,{xmlns:M.mucsub})),15e3)).getChild(`subscriptions`,M.mucsub)?.getChildren(`subscription`)??[]).map(e=>e.attrs.jid);return Promise.all(e.map(e=>this.groupInfo(e)))}async subscribed(e){return((await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:this.mucHost},O(`subscriptions`,{xmlns:M.mucsub})),15e3)).getChild(`subscriptions`,M.mucsub)?.getChildren(`subscription`)??[]).some(t=>N(t.attrs.jid)===e)}async groupInfo(e){let t=e.split(`@`)[0],n=[],r=!1;try{t=(await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:e},O(`query`,{xmlns:M.discoInfo})),1e4)).getChild(`query`,M.discoInfo)?.getChild(`identity`)?.attrs.name||t}catch{}try{n=((await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:e},O(`query`,{xmlns:M.mucAdmin},O(`item`,{affiliation:`member`}))),1e4)).getChild(`query`,M.mucAdmin)?.getChildren(`item`)??[]).map(e=>En(e.attrs.jid));let t=await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:e},O(`query`,{xmlns:M.mucAdmin},O(`item`,{affiliation:`owner`}))),1e4);for(let e of t.getChild(`query`,M.mucAdmin)?.getChildren(`item`)??[])n.push(En(e.attrs.jid)),En(e.attrs.jid)===this.cfg.username&&(r=!0)}catch{}let i=await this.groupAvatar(e).catch(()=>void 0);return{peer:e,name:t,members:[...new Set(n)],avatar:i,owner:r}}async upload(e){let t=await this.findUploadService(),n=(await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:t},O(`request`,{xmlns:M.upload,filename:e.name,size:String(e.size),"content-type":e.type||`application/octet-stream`})),3e4)).getChild(`slot`,M.upload),r=n?.getChild(`put`),i=n?.getChild(`get`)?.attrs.url;if(!r||!i)throw Error(`upload: no slot`);let a={"Content-Type":e.type||`application/octet-stream`};for(let e of r.getChildren(`header`))a[e.attrs.name]=e.text();let o=await fetch(r.attrs.url,{method:`PUT`,headers:a,body:e});if(!o.ok)throw Error(`upload: HTTP ${o.status}`);return i}async findUploadService(){if(this.uploadService)return this.uploadService;let e=async e=>{try{return(await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:e},O(`query`,{xmlns:M.discoInfo})),1e4)).getChild(`query`,M.discoInfo)?.getChildren(`feature`).some(e=>e.attrs.var===M.upload)??!1}catch{return!1}},t=[`upload.${this.domain}`];try{let e=await this.xmpp.iqCaller.request(O(`iq`,{type:`get`,to:this.domain},O(`query`,{xmlns:M.disco})),1e4);for(let n of e.getChild(`query`,M.disco)?.getChildren(`item`)??[])t.includes(n.attrs.jid)||t.push(n.attrs.jid)}catch{}for(let n of t)if(await e(n))return this.uploadService=n,n;throw Error(`upload: service not found`)}waiters=[];waitFor(e,t){return new Promise((n,r)=>{let i={test:e,resolve:n};this.waiters.push(i),setTimeout(()=>{let e=this.waiters.indexOf(i);e>=0&&(this.waiters.splice(e,1),r(Error(`timeout`)))},t)})}onStanza(e){for(let t of[...this.waiters])t.test(e)&&(this.waiters.splice(this.waiters.indexOf(t),1),t.resolve());if(e.is(`presence`)){let t=e.attrs.from??``,n=N(t);if(!n||n===this.me||n.endsWith(`@`+this.mucHost)||e.attrs.type===`error`||e.attrs.type?.startsWith(`subscribe`))return;let r=En(n),i=this.online.get(r)??new Set;e.attrs.type===`unavailable`?i.delete(t):i.add(t),this.online.set(r,i),this.h.presence(r,i.size>0);let a=e.getChild(`x`,M.hello);a&&!a.attrs.reply&&e.attrs.type!==`unavailable`&&this.xmpp.send(O(`presence`,{to:n},O(`x`,{xmlns:M.hello,reply:`1`}))).catch(()=>{});return}if(!e.is(`message`))return;let t=!e.attrs.from||N(e.attrs.from)===this.me,n=e.getChild(`result`,M.mam);if(n){if(!t)return;let e=n.getChild(`forwarded`,M.forward)?.getChild(`message`),r=this.mamQueries.get(n.attrs.queryid);if(e&&r){let t=this.reactionOf(e);t&&this.mamReactions.get(n.attrs.queryid)?.push(t);let i=t?void 0:this.toMessage(e,n.attrs.id,Dn(n.getChild(`forwarded`,M.forward)));i&&r.push(i)}return}let r=e.getChild(`received`,M.carbons)??e.getChild(`sent`,M.carbons);if(r){if(!t)return;let e=r.getChild(`forwarded`,M.forward)?.getChild(`message`);e&&this.deliver(e);return}let i=e.getChild(`event`,M.pubsubEvent);if(i?.getChild(`items`)?.attrs.node===M.mucsubConfig){let t=N(e.attrs.from);this.isGroup(t)&&On(i,`presence`)?.getChild(`x`,M.mucUser)?.getChild(`destroy`)&&this.h.groupDestroyed(t);return}let a=e.getChild(`x`,M.conference);if(a){let e=N(a.attrs.jid);this.isGroup(e)&&this.h.groupInvite(e);return}this.deliver(e)}deliver(e){let t=this.reactionOf(e);if(t){this.h.reaction(t);return}let n=this.toMessage(e,e.getChild(`stanza-id`,M.sid)?.attrs.id,Dn(e));if(n){this.h.message(n);return}if(e.attrs.type!==`chat`)return;let r=N(e.attrs.from),i=r===this.me?N(e.attrs.to):r,a=e.getChildByAttr(`xmlns`,M.chatstates);!e.getChild(`body`)&&a&&this.h.typing(En(i),a.name===`composing`)}reactionOf(e){let t=e.getChild(`event`,M.pubsubEvent),n=e,r;if(t&&t.getChild(`items`)?.attrs.node===M.mucsubMessages){r=N(e.attrs.from);let i=kn(t);if(!this.isGroup(r)||!i||N(i.attrs.from)!==r)return;n=i}else if(e.attrs.type===`groupchat`&&(r=N(e.attrs.from),!this.isGroup(r)))return;let i=n.getChild(`reactions`,M.reactions),a=i?.attrs.id;if(!i||!a)return;let o=[...new Set(i.getChildren(`reaction`).map(e=>e.text().trim()).filter(e=>e&&e.length<=16))].slice(0,5);if(r){let e=(n.attrs.from??``).split(`/`)[1]??``;return e?{peer:r,target:a,user:e,emojis:o}:void 0}if(n.attrs.type!==`chat`)return;let s=N(n.attrs.from),c=s===this.me||!n.attrs.from,l=En(c?N(n.attrs.to):s);return l?{peer:l,target:a,user:c?this.cfg.username:En(s),emojis:o}:void 0}toMessage(e,t,n){let r=this.parseMessage(e,t,n);return r&&wn(r,On(e,`reply`)?e.getChild(`event`,M.pubsubEvent)?kn(e.getChild(`event`,M.pubsubEvent)):e:void 0)}parseMessage(e,t,n){let r=e.getChild(`event`,M.pubsubEvent);if(r&&r.getChild(`items`)?.attrs.node===M.mucsubMessages){let i=N(e.attrs.from);if(!this.isGroup(i))return;let a=kn(r);if(!a||N(a.attrs.from)!==i)return;let o=(a.attrs.from??``).split(`/`)[1]??``,s=a.getChildText(`body`);return s==null?void 0:{id:a.getChild(`origin-id`,M.sid)?.attrs.id??t??a.getChild(`stanza-id`,M.sid)?.attrs.id??a.attrs.id??crypto.randomUUID(),oid:a.getChild(`origin-id`,M.sid)?.attrs.id??a.attrs.id,from:i,to:this.cfg.username,body:s,ts:Dn(a)!==n&&a.getChild(`delay`,M.delay)?Dn(a):n,mine:o===this.cfg.username,oob:a.getChild(`x`,M.oob)?.getChildText(`url`)??void 0,room:i,nick:o}}let i=e.getChildText(`body`);if(i==null)return;let a=N(e.attrs.from);if(e.attrs.type===`groupchat`){if(!this.isGroup(a))return;let r=(e.attrs.from??``).split(`/`)[1]??``;return{id:t??e.getChild(`origin-id`,M.sid)?.attrs.id??e.attrs.id??crypto.randomUUID(),oid:e.getChild(`origin-id`,M.sid)?.attrs.id??e.attrs.id,from:a,to:this.cfg.username,body:i,ts:n,mine:r===this.cfg.username,oob:e.getChild(`x`,M.oob)?.getChildText(`url`)??void 0,room:a,nick:r}}if(e.attrs.type!==`chat`)return;let o=a===this.me;return{id:t??e.getChild(`origin-id`,M.sid)?.attrs.id??e.attrs.id??crypto.randomUUID(),oid:e.getChild(`origin-id`,M.sid)?.attrs.id??e.attrs.id,from:En(a),to:En(N(e.attrs.to)),body:i,ts:n,mine:o,oob:e.getChild(`x`,M.oob)?.getChildText(`url`)??void 0}}},N=(e=``)=>e.split(`/`)[0];function wn(e,t){let n=t?.getChild(`reply`,M.reply);if(!n?.attrs.id)return e;let r=n.attrs.to??``,i=e.room?r.split(`/`)[1]??``:En(N(r)),a=t.getChildren(`fallback`,M.fallback).find(e=>e.attrs.for===M.reply)?.getChild(`body`),o=[...e.body],s=Number(a?.attrs.start??0),c=Number(a?.attrs.end??0);if(!a||!(c>s)||c>o.length)return{...e,reply:{id:n.attrs.id,author:i}};let l=o.slice(s,c).join(``).replace(/^> ?/gm,``).trim();return{...e,body:(o.slice(0,s).join(``)+o.slice(c).join(``)).trim(),reply:{id:n.attrs.id,author:i,quote:l}}}var Tn=e=>e.name===`SASLError`||e.condition===`not-authorized`,En=(e=``)=>e.split(`@`)[0],Dn=e=>{let t=e?.getChild(`delay`,M.delay)?.attrs.stamp;return t?Date.parse(t):Date.now()};function On(e,t){for(let n of e.children){if(typeof n==`string`)continue;if(n.name===t)return n;let e=On(n,t);if(e)return e}}var kn=e=>On(e,`message`),An;function jn(){try{An??=new AudioContext,An.state===`suspended`&&An.resume();let e=An.currentTime;for(let[t,n,r]of[[880,0,.09],[1174.7,.1,.16]]){let i=An.createOscillator(),a=An.createGain();i.type=`sine`,i.frequency.value=t,a.gain.setValueAtTime(1e-4,e+n),a.gain.exponentialRampToValueAtTime(.12,e+n+.01),a.gain.exponentialRampToValueAtTime(1e-4,e+n+r),i.connect(a).connect(An.destination),i.start(e+n),i.stop(e+n+r+.02)}}catch{}}var Mn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Nn=e=>e?Mn(e):Mn,Pn=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Fn=o(((e,t)=>{t.exports=Pn()})),In=o((e=>{var t=u(),n=Fn();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ln=c(o(((e,t)=>{t.exports=In()}))(),1),{useDebugValue:Rn}=g.default,{useSyncExternalStoreWithSelector:zn}=Ln.default,Bn=e=>e;function Vn(e,t=Bn,n){let r=zn(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Rn(r),r}var Hn=e=>{let t=typeof e==`function`?Nn(e):e,n=(e,n)=>Vn(t,e,n);return Object.assign(n,t),n},Un=e=>e?Hn(e):Hn,Wn=e=>e.room??(e.mine?e.to:e.from),Gn=(e,t)=>({peer:e,kind:t&&e.endsWith(`@`+t)?`group`:`chat`,messages:[],unread:0,typing:!1,loaded:!1,complete:!1}),Kn=(e,t,n,r)=>{if(e.includes(t))return e;let i=[t,...e];if(i.length<=n)return i;let a=[...i].reverse().find(e=>e!==r);return i.filter(e=>e!==a)},P=Un((e,t)=>({me:``,myName:``,mucHost:``,status:`connecting`,contacts:{},online:{},mobile:{},conversations:{},order:[],open:null,picker:!1,push:`unavailable`,enablePush:()=>{},maxHeads:5,newChatButton:!0,setStatus:(t,n)=>e({status:t,error:n}),reset:()=>e({status:`connecting`,error:void 0,contacts:{},online:{},mobile:{},conversations:{},order:[],open:null,picker:!1}),setContacts:t=>e({contacts:Object.fromEntries(t.filter(e=>e?.username).map(e=>[e.username,{...e,name:e.name||e.username}]))}),setMobile:t=>e({mobile:Object.fromEntries(t.map(e=>[e,!0]))}),setOnline:(t,n)=>e(e=>e.online[t]===n?{}:{online:{...e.online,[t]:n}}),ensure:n=>{let r=t().conversations[n];if(r)return r;let i=Gn(n,t().mucHost);return e(e=>({conversations:{...e.conversations,[n]:i}})),i},setGroup:(t,n,r,i,a)=>e(e=>{let o=e.conversations[t]??Gn(t,e.mucHost);return{conversations:{...e.conversations,[t]:{...o,kind:`group`,name:n,members:r,avatar:i??o.avatar,owner:a??o.owner}}}}),seed:(t,n)=>e(e=>{let r={...e.conversations};for(let i of t){let t=Wn(i);if(!t||t===n)continue;let a=r[t]??Gn(t,e.mucHost);if(a.messages.some(e=>e.id===i.id))continue;if(a.loaded){r[t]={...a,messages:[...a.messages,i].sort((e,t)=>e.ts-t.ts)};continue}let o=a.messages[a.messages.length-1];r[t]={...a,messages:!o||o.ts<=i.ts?[i]:a.messages}}return{conversations:r}}),addMessage:(t,n,r)=>e(e=>{let i=e.conversations[t]??Gn(t,e.mucHost),a=i.messages.filter(e=>e.id!==n.id&&!(e.pending&&n.mine&&e.body===n.body&&e.oob===n.oob)),o=a.length;for(;o>0&&a[o-1].ts>n.ts;)o--;a.splice(o,0,n);let s=e.open===t,c=r?.live&&!n.mine&&!s?i.unread+1:i.unread,l=Kn(e.order,t,e.maxHeads,e.open);return{conversations:{...e.conversations,[t]:{...i,messages:a,unread:c,typing:n.mine?i.typing:!1}},order:l}}),prependHistory:(t,n,r,i)=>e(e=>{let a=e.conversations[t]??Gn(t,e.mucHost),o=new Set(a.messages.map(e=>e.id)),s=[...n.filter(e=>!o.has(e.id)),...a.messages].sort((e,t)=>e.ts-t.ts);return{conversations:{...e.conversations,[t]:{...a,messages:s,loaded:!0,complete:r,oldest:i??a.oldest}}}}),applyReactions:t=>e(e=>{if(!t.length)return{};let n={...e.conversations};for(let r of t){let t=n[r.peer]??Gn(r.peer,e.mucHost),i={...t.reactions??{}},a={...i[r.target]??{}};r.emojis.length?a[r.user]=r.emojis:delete a[r.user],i[r.target]=a,n[r.peer]={...t,reactions:i}}return{conversations:n}}),setTyping:(t,n)=>e(e=>e.conversations[t]?{conversations:{...e.conversations,[t]:{...e.conversations[t],typing:n}}}:{}),openChat:t=>e(e=>({conversations:e.conversations[t]?e.conversations:{...e.conversations,[t]:Gn(t,e.mucHost)},order:Kn(e.order,t,e.maxHeads,e.open),open:t,picker:!1})),closeChat:()=>e({open:null}),removeConversation:t=>e(e=>{let n={...e.conversations};return delete n[t],{conversations:n,order:e.order.filter(e=>e!==t),open:e.open===t?null:e.open}}),removeHead:t=>e(e=>({order:e.order.filter(e=>e!==t),open:e.open===t?null:e.open})),markRead:t=>e(e=>e.conversations[t]&&e.conversations[t].unread?{conversations:{...e.conversations,[t]:{...e.conversations[t],unread:0}}}:{}),setPicker:t=>e({picker:t}),totalUnread:()=>Object.values(t().conversations).reduce((e,t)=>e+t.unread,0)}));function qn(e,t,n){return Object.values(e??{}).filter(e=>e?.username&&e.username!==n).map(e=>({username:e.username,name:e.name||e.username,avatar:t?.[e.username],presence:e.mainPresence,number:e.endpoints?.mainextension?.[0]?.id}))}async function Jn(e,t,n){let r=await fetch(`https://${e}/api${n}`,{headers:{Authorization:`Bearer ${t}`}});if(!r.ok)throw Error(`${n}: HTTP ${r.status}`);return await r.json()}async function Yn(e,t,n,r){let i=await Jn(e,t,`/user/endpoints/all`),a={};try{a=await Jn(e,t,`/user/all_avatars`)}catch{}let o=Object.values(i).find(e=>e.username===n)?.name;return o&&r?.(o),qn(i,a,n).sort((e,t)=>e.name.localeCompare(t.name))}async function Xn(e,t){let n=await fetch(`https://${e}/chat-gw/push/mobile`,{headers:{Authorization:`Bearer ${t}`}});if(!n.ok)throw Error(`push/mobile: HTTP ${n.status}`);return(await n.json()).users}async function Zn(e,t,n){let r=await fetch(`https://${e}/chat-gw/conversations/${encodeURIComponent(n)}`,{method:`DELETE`,headers:{Authorization:`Bearer ${t}`}});if(!r.ok)throw Error(`delete: HTTP ${r.status}`)}var Qn=e=>{let t=atob((e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(t,e=>e.charCodeAt(0))},$n=!1;function er(){$n||($n=!0,navigator.serviceWorker.addEventListener(`message`,e=>{e.data?.type===`chat-island-open`&&typeof e.data.username==`string`&&window.dispatchEvent(new CustomEvent(`chat-island-open`,{detail:{username:e.data.username}}))}))}async function tr(e,t){if(!(`serviceWorker`in navigator)||!(`PushManager`in window))throw Error(`push not supported by this browser`);if(Notification.permission===`denied`||Notification.permission!==`granted`&&await Notification.requestPermission()!==`granted`)return null;let n=`https://${e.host}/chat-gw`,r=await fetch(`${n}/push/vapid`);if(!r.ok)throw Error(`vapid: HTTP ${r.status}`);let i=await r.json(),a=await navigator.serviceWorker.register(t);await navigator.serviceWorker.ready;let o=await a.pushManager.getSubscription()??await a.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Qn(i.publicKey)}),s=await fetch(`${n}/push/web`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${e.token}`},body:JSON.stringify(o.toJSON())});if(!s.ok)throw Error(`push/web: HTTP ${s.status} ${(await s.text()).slice(0,120)}`);let c=await s.json();return er(),{node:c.node,service:c.service}}function F(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function nr(e,t){let n=e=>t(e.detail);return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}var rr=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),I=o(((e,t)=>{t.exports=rr()}))(),ir=e=>e.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``);function ar({contact:e,username:t,size:n=40}){let r=e?.name||t,i={width:n,height:n,fontSize:n/2.6};return e?.avatar?(0,I.jsx)(`img`,{src:e.avatar,alt:r,style:i,draggable:!1,className:`ci-rounded-full ci-object-cover ci-shrink-0`}):(0,I.jsx)(`div`,{style:i,className:`ci-rounded-full ci-shrink-0 ci-flex ci-items-center ci-justify-center ci-font-medium ci-bg-gray-700 ci-text-gray-50 dark:ci-bg-gray-300 dark:ci-text-gray-900`,children:ir(r)})}function or({online:e,presence:t,mobile:n}){return(0,I.jsx)(`span`,{className:`ci-absolute ci-bottom-0 ci-right-0 ci-w-3 ci-h-3 ci-rounded-full ci-ring-2 ci-ring-gray-50 dark:ci-ring-gray-950 ${t===`dnd`||t===`busy`?`ci-bg-phoneIslandClose dark:ci-bg-phoneIslandCloseDark`:e||n?`ci-bg-phoneIslandCall dark:ci-bg-phoneIslandCallDark`:`ci-bg-gray-400 dark:ci-bg-gray-600`}`})}function sr({name:e,size:t=40,avatar:n}){let r={width:t,height:t,fontSize:t/2.8};return n?(0,I.jsx)(`img`,{src:n,alt:e,style:r,draggable:!1,className:`ci-rounded-full ci-object-cover ci-shrink-0`}):(0,I.jsx)(`div`,{style:r,className:`ci-rounded-full ci-shrink-0 ci-flex ci-items-center ci-justify-center ci-font-medium ci-bg-iconSecondary dark:ci-bg-iconSecondaryDark ci-text-white`,children:ir(e||`G`)})}var cr=`ci-flex ci-content-center ci-items-center ci-justify-center ci-tracking-wide ci-duration-200 ci-transform ci-outline-none focus:ci-ring-2 focus:ci-z-20 focus:ci-ring-offset-2 disabled:ci-opacity-40 disabled:ci-cursor-not-allowed ci-border ci-border-transparent focus:ci-ring-offset-white dark:focus:ci-ring-offset-black ci-text-sm ci-leading-4 ci-transition-colors ci-shrink-0 ci-font-light`,lr={default:`ci-bg-phoneIslandActive dark:ci-bg-phoneIslandActiveDark hover:ci-bg-gray-500 dark:hover:ci-bg-gray-50 focus:ci-ring-emerald-500 dark:focus:ci-ring-emerald-300 ci-text-primaryInvert dark:ci-text-primaryInvertDark ci-h-12 ci-w-12 ci-rounded-full`,green:`ci-bg-phoneIslandCall dark:ci-bg-phoneIslandCallDark hover:ci-bg-phoneIslandCallHover dark:hover:ci-bg-phoneIslandCallHoverDark focus:ci-ring-green-500 ci-text-white dark:ci-text-gray-950 ci-h-12 ci-w-12 ci-rounded-full`,red:`ci-bg-phoneIslandClose dark:ci-bg-phoneIslandCloseDark hover:ci-bg-phoneIslandCloseHover dark:hover:ci-bg-phoneIslandCloseHoverDark focus:ci-ring-emerald-500 ci-text-white dark:ci-text-gray-950 ci-h-12 ci-w-12 ci-rounded-full`,neutral:`ci-bg-transparent enabled:hover:ci-bg-gray-500 enabled:hover:ci-border-gray-500 ci-border ci-border-gray-700 focus:ci-ring-0 ci-text-secondaryNeutral dark:ci-text-secondaryNeutralDark ci-h-12 ci-w-12 ci-rounded-full`,transparent:`ci-bg-transparent dark:enabled:hover:ci-bg-gray-700/30 enabled:hover:ci-bg-gray-300/70 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500 ci-text-secondaryNeutral dark:ci-text-secondaryNeutralDark ci-h-12 ci-w-12 ci-rounded-full`,call:`ci-bg-phoneIslandCall dark:ci-bg-phoneIslandCallDark hover:ci-bg-phoneIslandCallHover dark:hover:ci-bg-phoneIslandCallHoverDark focus:ci-ring-green-500 ci-text-white dark:ci-text-gray-950 ci-h-8 ci-w-8 ci-rounded-full`,small:`ci-bg-transparent dark:hover:ci-bg-gray-600 hover:ci-bg-gray-300 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500 ci-text-gray-700 dark:ci-text-white ci-h-8 ci-w-8 ci-rounded`};function ur({variant:e,className:t=``,children:n,...r}){return(0,I.jsx)(`button`,{type:`button`,"aria-label":r[`aria-label`]??r.title,className:`${cr} ${lr[e]} ${t}`,...r,children:n})}var L={chat:(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 512 512`,fill:`currentColor`,children:(0,I.jsx)(`path`,{d:`M0 240c0 54.4 19.3 104.6 51.9 144.9L3.1 474.3c-2 3.7-3.1 7.9-3.1 12.2 0 14.1 11.4 25.5 25.5 25.5 4 0 7.8-.6 11.5-2.1L153.4 460c31.4 12.9 66.1 20 102.6 20 141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240zM94 407.9c9.3-17.1 7.4-38.1-4.8-53.2-26.1-32.3-41.2-71.9-41.2-114.7 0-103.2 90.2-192 208-192s208 88.8 208 192-90.2 192-208 192c-30.2 0-58.7-5.9-84.3-16.4-11.9-4.9-25.3-4.8-37.1 .3L76 440.9 94 407.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z`})}),bell:(0,I.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 0 1-3.46 0`})}),clip:(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`})}),send:(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z`})}),phone:(0,I.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z`})}),mic:(0,I.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`path`,{d:`M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z`}),(0,I.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2M12 19v4M8 23h8`})]}),camera:(0,I.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`path`,{d:`M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z`}),(0,I.jsx)(`circle`,{cx:`12`,cy:`13`,r:`4`})]}),trash:(0,I.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6`})}),reply:(0,I.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`path`,{d:`M9 17l-5-5 5-5`}),(0,I.jsx)(`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`})]}),minus:(0,I.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,I.jsx)(`path`,{d:`M5 12h14`})}),close:(0,I.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,I.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})}),smile:(0,I.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,I.jsx)(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01`})]}),react:(0,I.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,I.jsx)(`path`,{d:`M20.5 11A8.5 8.5 0 1 1 13 3.5`}),(0,I.jsx)(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01M19 2v6M16 5h6`})]}),search:(0,I.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,I.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,I.jsx)(`path`,{d:`M21 21l-4.35-4.35`})]})};function dr({onDragStart:e,pushButton:t=!0}){let{order:n,open:r,conversations:i,contacts:a,online:o,mobile:s,openChat:c,removeHead:l,picker:u,setPicker:d,status:f,push:p,enablePush:m,newChatButton:h}=P(y(e=>({order:e.order,open:e.open,conversations:e.conversations,contacts:e.contacts,online:e.online,mobile:e.mobile,openChat:e.openChat,removeHead:e.removeHead,picker:e.picker,setPicker:e.setPicker,status:e.status,push:e.push,enablePush:e.enablePush,newChatButton:e.newChatButton})));return(0,I.jsxs)(`div`,{className:`ci-flex ci-flex-col-reverse ci-items-center ci-gap-3 ci-mb-3 ${e?`ci-cursor-grab active:ci-cursor-grabbing ci-touch-none`:``}`,onPointerDown:e,children:[n.map(e=>{let t=i[e],n=r===e;return(0,I.jsxs)(`div`,{className:`ci-relative ci-group`,children:[(0,I.jsxs)(`button`,{type:`button`,title:t?.kind===`group`?t.name??e:a[e]?.name??e,onClick:()=>n?P.getState().closeChat():c(e),className:`ci-relative ci-rounded-full ci-shadow-lg ci-transition-transform hover:ci-scale-105 ci-ring-2 ci-border-0 ci-p-0 ci-bg-transparent ${n?`ci-ring-iconSecondary dark:ci-ring-iconSecondaryDark`:`ci-ring-gray-50 dark:ci-ring-gray-950`}`,children:[t?.kind===`group`?(0,I.jsx)(sr,{name:t.name??e,size:48,avatar:t.avatar}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ar,{contact:a[e],username:e,size:48}),(0,I.jsx)(or,{online:o[e],presence:a[e]?.presence,mobile:s[e]})]}),t?.unread>0&&(0,I.jsx)(`span`,{className:`ci-absolute ci--top-1 ci--right-1 ci-min-w-5 ci-h-5 ci-px-1 ci-rounded-full ci-bg-phoneIslandClose dark:ci-bg-phoneIslandCloseDark ci-text-white dark:ci-text-gray-950 ci-text-xs ci-font-medium ci-flex ci-items-center ci-justify-center`,children:t.unread>99?`99+`:t.unread})]}),(0,I.jsx)(`button`,{type:`button`,"aria-label":`Remove ${t?.kind===`group`?t.name??e:a[e]?.name??e} from the dock`,onClick:()=>l(e),className:`ci-absolute ci--top-1 ci--left-1 ci-hidden group-hover:ci-flex group-focus-within:ci-flex ci-w-5 ci-h-5 ci-rounded-full ci-border-0 ci-p-0 ci-bg-gray-700 dark:ci-bg-gray-300 ci-text-gray-50 dark:ci-text-gray-900 ci-items-center ci-justify-center`,children:L.close})]},e)}),h&&(0,I.jsxs)(ur,{variant:`default`,title:f===`online`?`New chat`:`Chat ${f}`,onClick:()=>d(!u),className:`ci-relative ci-shadow-lg`,children:[L.chat,f!==`online`&&(0,I.jsx)(`span`,{className:`ci-absolute ci-bottom-0 ci-right-0 ci-w-3 ci-h-3 ci-rounded-full ci-bg-phoneIslandClose dark:ci-bg-phoneIslandCloseDark ci-ring-2 ci-ring-gray-50 dark:ci-ring-gray-950`})]}),t&&p===`ask`&&f===`online`&&(0,I.jsx)(ur,{variant:`neutral`,title:`Enable notifications when the tab is closed`,onClick:m,className:`ci-shadow-lg ci-bg-gray-50 dark:ci-bg-gray-950`,children:L.bell})]})}var fr={"+1":`👍`,thumbsup:`👍`,"-1":`👎`,thumbsdown:`👎`,ok_hand:`👌`,clap:`👏`,pray:`🙏`,wave:`👋`,raised_hands:`🙌`,muscle:`💪`,point_up:`☝️`,point_right:`👉`,point_left:`👈`,point_down:`👇`,v:`✌️`,crossed_fingers:`🤞`,handshake:`🤝`,eyes:`👀`,facepalm:`🤦`,shrug:`🤷`,raising_hand:`🙋`,heart:`❤️`,broken_heart:`💔`,orange_heart:`🧡`,yellow_heart:`💛`,green_heart:`💚`,blue_heart:`💙`,purple_heart:`💜`,black_heart:`🖤`,white_heart:`🤍`,sparkling_heart:`💖`,two_hearts:`💕`,100:`💯`,fire:`🔥`,star:`⭐`,star2:`🌟`,sparkles:`✨`,zap:`⚡`,boom:`💥`,tada:`🎉`,confetti_ball:`🎊`,balloon:`🎈`,gift:`🎁`,birthday:`🎂`,cake:`🍰`,trophy:`🏆`,medal:`🏅`,rocket:`🚀`,white_check_mark:`✅`,heavy_check_mark:`✔️`,x:`❌`,warning:`⚠️`,question:`❓`,exclamation:`❗`,no_entry:`⛔`,ok:`🆗`,new:`🆕`,sos:`🆘`,heavy_plus_sign:`➕`,heavy_minus_sign:`➖`,smile:`😄`,smiley:`😃`,grinning:`😀`,grin:`😁`,laughing:`😆`,satisfied:`😆`,sweat_smile:`😅`,joy:`😂`,rofl:`🤣`,slightly_smiling_face:`🙂`,upside_down_face:`🙃`,wink:`😉`,blush:`😊`,innocent:`😇`,heart_eyes:`😍`,star_struck:`🤩`,kissing_heart:`😘`,yum:`😋`,stuck_out_tongue:`😛`,stuck_out_tongue_winking_eye:`😜`,zany_face:`🤪`,money_mouth_face:`🤑`,hugs:`🤗`,hugging_face:`🤗`,shushing_face:`🤫`,thinking:`🤔`,thinking_face:`🤔`,zipper_mouth_face:`🤐`,raised_eyebrow:`🤨`,neutral_face:`😐`,expressionless:`😑`,no_mouth:`😶`,smirk:`😏`,unamused:`😒`,roll_eyes:`🙄`,grimacing:`😬`,relieved:`😌`,pensive:`😔`,sleepy:`😪`,sleeping:`😴`,mask:`😷`,face_with_thermometer:`🤒`,nauseated_face:`🤢`,sneezing_face:`🤧`,hot_face:`🥵`,cold_face:`🥶`,dizzy_face:`😵`,exploding_head:`🤯`,cowboy_hat_face:`🤠`,partying_face:`🥳`,sunglasses:`😎`,nerd_face:`🤓`,confused:`😕`,worried:`😟`,slightly_frowning_face:`🙁`,open_mouth:`😮`,astonished:`😲`,flushed:`😳`,pleading_face:`🥺`,fearful:`😨`,cold_sweat:`😰`,cry:`😢`,sob:`😭`,scream:`😱`,disappointed:`😞`,weary:`😩`,tired_face:`😫`,yawning_face:`🥱`,triumph:`😤`,rage:`😡`,angry:`😠`,cursing_face:`🤬`,smiling_imp:`😈`,skull:`💀`,poop:`💩`,hankey:`💩`,clown_face:`🤡`,ghost:`👻`,alien:`👽`,robot:`🤖`,see_no_evil:`🙈`,hear_no_evil:`🙉`,speak_no_evil:`🙊`,coffee:`☕`,tea:`🍵`,beer:`🍺`,beers:`🍻`,wine_glass:`🍷`,clinking_glasses:`🥂`,pizza:`🍕`,hamburger:`🍔`,sunny:`☀️`,cloud:`☁️`,rainbow:`🌈`,snowflake:`❄️`,umbrella:`☔`,phone:`☎️`,telephone_receiver:`📞`,iphone:`📱`,computer:`💻`,email:`📧`,calendar:`📅`,memo:`📝`,pencil2:`✏️`,paperclip:`📎`,pushpin:`📌`,lock:`🔒`,key:`🔑`,bulb:`💡`,hourglass:`⌛`,hourglass_flowing_sand:`⏳`,alarm_clock:`⏰`,stopwatch:`⏱️`,bell:`🔔`,mega:`📣`,loudspeaker:`📢`,speech_balloon:`💬`,thought_balloon:`💭`,moneybag:`💰`,car:`🚗`,airplane:`✈️`,house:`🏠`,office:`🏢`,earth_africa:`🌍`,globe_with_meridians:`🌐`,arrow_right:`➡️`,arrow_left:`⬅️`,arrow_up:`⬆️`,arrow_down:`⬇️`,recycle:`♻️`,zzz:`💤`,sweat_drops:`💦`,dash:`💨`},pr=/(```[\s\S]*?(?:```|$)|`[^`\n]*`?)/g,mr=/:([a-z0-9_+-]+):/g,hr=e=>e.replace(mr,(e,t)=>fr[t]??e);function gr(e){return e.includes(`:`)?e.split(pr).map((e,t)=>t%2?e:hr(e)).join(``):e}var _r=[{label:`Smileys`,icon:`😀`,emojis:`😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 😉 😊 😇 🥰 😍 🤩 😘 😗 😚 😙 😋 😛 😜 🤪 😝 🤑 🤗 🤭 🤫 🤔 🤐 🤨 😐 😑 😶 😏 😒 🙄 😬 😌 😔 😪 🤤 😴 😷 🤒 🤕 🤢 🤮 🤧 🥵 🥶 🥴 😵 🤯 🤠 🥳 😎 🤓 🧐 😕 😟 🙁 ☹️ 😮 😯 😲 😳 🥺 😦 😧 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 🥱 😤 😡 😠 🤬 😈 💀 💩 🤡 👻 👽 🤖`},{label:`Gestures`,icon:`👍`,emojis:`👍 👎 👌 🤌 🤏 ✌️ 🤞 🤟 🤘 🤙 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐️ 🖖 👋 👏 🙌 👐 🤲 🤝 🙏 ✍️ 💪 🫶 👀 🧠 🙋 🙆 🙅 🤷 🤦 🙇`},{label:`Hearts and symbols`,icon:`❤️`,emojis:`❤️ 🧡 💛 💚 💙 💜 🖤 🤍 🤎 💔 ❣️ 💕 💞 💓 💗 💖 💘 💝 💯 💢 💥 💫 💦 💨 🔥 ✨ ⭐ 🌟 ✅ ❌ ⚠️ ❓ ❗ ➕ ➖ 🆗 🆕 🔴 🟢 🟡 🔵`},{label:`Celebrations`,icon:`🎉`,emojis:`🎉 🎊 🎈 🎁 🎂 🍰 🥂 🍾 🍻 🍺 🍷 🏆 🥇 🥈 🥉 🏅 🎯 🎮 ⚽ 🏀 🎾 🚴 🏃 🎵 🎶 📸 🎬`},{label:`Work`,icon:`💼`,emojis:`💼 📞 ☎️ 📱 💻 🖥️ ⌨️ 🖨️ 📧 📨 📩 📅 📆 🗓️ 📌 📍 📎 ✂️ 📝 ✏️ 📁 📂 🗂️ 📊 📈 📉 🔒 🔓 🔑 🔧 🛠️ ⚙️ 💡 🔋 ⏰ ⏳ ⌛ 🧾 💶 💰`},{label:`Food and places`,icon:`☕`,emojis:`☕ 🍵 🥤 🍕 🍔 🍟 🌭 🥪 🌮 🍝 🍣 🍩 🍪 🍫 🍎 🍌 🍓 🥐 🚗 🚕 🚌 🚆 ✈️ 🚀 🏠 🏢 🏖️ 🌍 ☀️ 🌤️ 🌧️ ⛈️ ❄️ ⚡ 🌈 🌙`}],vr=[`👍`,`❤️`,`😂`,`😮`,`😢`,`🙏`];function yr({onPick:e,onClose:t,className:n=``}){let[r,i]=(0,g.useState)(0),a=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let e=e=>a.current&&!a.current.contains(e.target)&&t(),n=e=>{e.key===`Escape`&&(e.stopPropagation(),t())};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,n,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,n,!0)}},[t]),(0,I.jsxs)(`div`,{ref:a,role:`dialog`,"aria-label":`Emoji`,className:`ci-z-30 ci-w-[21rem] ci-max-w-full ci-rounded-2xl ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-2xl ci-ring-1 ci-ring-gray-300 dark:ci-ring-gray-700 ci-select-none ${n}`,children:[(0,I.jsx)(`div`,{className:`ci-flex ci-gap-1 ci-px-2 ci-pt-2 ci-border-b ci-border-gray-300 dark:ci-border-gray-700`,children:_r.map((e,t)=>(0,I.jsx)(`button`,{type:`button`,title:e.label,"aria-label":e.label,onClick:()=>i(t),style:{fontSize:20,lineHeight:`28px`},className:`ci-flex-1 ci-pb-1.5 ci-border-0 ci-bg-transparent ci-border-b-2 ci-border-solid ${t===r?`ci-border-iconSecondary dark:ci-border-iconSecondaryDark`:`ci-border-transparent ci-opacity-60 hover:ci-opacity-100`}`,children:e.icon},e.label))}),(0,I.jsx)(`div`,{className:`ci-grid ci-grid-cols-7 ci-gap-1 ci-p-2 ci-h-64 ci-overflow-y-auto`,children:_r[r].emojis.split(` `).map(t=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>e(t),style:{fontSize:26,lineHeight:`36px`},className:`ci-h-10 ci-w-10 ci-flex ci-items-center ci-justify-center ci-rounded-lg ci-border-0 ci-bg-transparent hover:ci-bg-gray-200 dark:hover:ci-bg-gray-800`,children:t},t))})]})}var br=e=>/\.(png|jpe?g|gif|webp|avif|svg)(\?|$)/i.test(e),xr=e=>/\.(webm|ogg|oga|opus|mp3|m4a|wav)(\?|$)/i.test(e),Sr=e=>{let t=e.split(`/`).pop()||`file`;try{return decodeURIComponent(t)}catch{return t}},Cr=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},wr=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),Tr=e=>new Date(e).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),Er=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString(),Dr=e=>{if(!e.startsWith(`{"`))return null;try{let t=JSON.parse(e);return!Array.isArray(t.attachments)||!t.attachments.length?null:{text:typeof t.body==`string`&&t.body?t.body:void 0,count:t.attachments.length}}catch{return null}},Or=(0,g.memo)(function({url:e}){return Cr(e)?br(e)?(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:(0,I.jsx)(`img`,{src:e,alt:Sr(e),className:`ci-max-w-full ci-max-h-60 ci-rounded-2xl ci-block`})}):xr(e)?(0,I.jsx)(`audio`,{controls:!0,src:e,className:`ci-max-w-full`}):(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`ci-underline ci-break-all ci-flex ci-items-center ci-gap-1`,children:[(0,I.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,I.jsx)(`path`,{d:`M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`})}),Sr(e)]}):(0,I.jsx)(`span`,{className:`ci-break-all`,children:e})}),kr=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*|__[^_\n]+__)|(~~[^~\n]+~~)|(\*[^*\s][^*\n]*\*|_[^_\s][^_\n]*_)|\[([^\]\n]+)\]\((https?:\/\/[^\s)]+)\)|(https?:\/\/[^\s<]+)/g;function Ar({text:e}){let t=[],n=0;for(let r of e.matchAll(kr)){let i=r[0],a=r.index??0;a>n&&t.push(gr(e.slice(n,a))),r[1]?t.push((0,I.jsx)(`code`,{className:`ci-px-1 ci-py-0.5 ci-rounded ci-bg-black/10 dark:ci-bg-white/10 ci-font-mono ci-text-[0.85em]`,children:i.slice(1,-1)},a)):r[2]?t.push((0,I.jsx)(`strong`,{children:i.slice(2,-2)},a)):r[3]?t.push((0,I.jsx)(`s`,{children:i.slice(2,-2)},a)):r[4]?t.push((0,I.jsx)(`em`,{children:i.slice(1,-1)},a)):r[5]?t.push((0,I.jsx)(`a`,{href:r[6],target:`_blank`,rel:`noreferrer`,className:`ci-underline`,children:r[5]},a)):t.push((0,I.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`ci-underline ci-break-all`,children:i},a)),n=a+i.length}return n<e.length&&t.push(gr(e.slice(n))),(0,I.jsx)(I.Fragment,{children:t})}var jr=(0,g.memo)(function({text:e}){let t=e.split(/```[^\n]*\n?([\s\S]*?)```/g);return(0,I.jsx)(`span`,{className:`ci-whitespace-pre-wrap ci-break-words`,children:t.map((e,t)=>t%2?(0,I.jsx)(`pre`,{className:`ci-my-1 ci-p-2 ci-rounded-xl ci-bg-black/10 dark:ci-bg-white/10 ci-font-mono ci-text-xs ci-overflow-x-auto ci-whitespace-pre`,children:e.replace(/\n$/,``)},t):(0,I.jsx)(Ar,{text:e.replace(/^(\s*)[-*] (?=\S)/gm,`$1• `)},t))})});function Mr({text:e,count:t}){return(0,I.jsxs)(`span`,{className:`ci-italic ci-opacity-80`,children:[e&&(0,I.jsx)(`span`,{className:`ci-not-italic ci-block`,children:e}),t>1?`${t} attachments`:`Attachment`,` from the mobile app, not available here`]})}function Nr({forMsg:e,me:t,onReact:n,nameOf:r,mine:i}){if(!e)return null;let a=new Map;for(let[t,n]of Object.entries(e))for(let e of n)a.set(e,[...a.get(e)??[],t]);return a.size?(0,I.jsx)(`div`,{className:`ci-flex ci-flex-wrap ci-gap-1 ci--mt-1.5 ci-relative ci-z-[1] ${i?`ci-justify-end ci-pr-2`:`ci-pl-2`}`,children:[...a.entries()].map(([e,i])=>{let a=i.includes(t);return(0,I.jsxs)(`button`,{type:`button`,title:i.map(e=>e===t?`You`:r(e)).join(`, `),"aria-label":`${e} ${i.length}${a?`, yours: press to remove`:``}`,onClick:()=>n(e),className:`ci-flex ci-items-center ci-gap-0.5 ci-h-6 ci-px-1.5 ci-rounded-full ci-text-xs ci-border ci-border-solid ci-shadow-sm ${a?`ci-bg-emerald-50 ci-border-emerald-400 dark:ci-bg-emerald-950 dark:ci-border-emerald-600`:`ci-bg-gray-50 ci-border-gray-300 dark:ci-bg-gray-900 dark:ci-border-gray-700`} ci-text-gray-900 dark:ci-text-white`,children:[(0,I.jsx)(`span`,{style:{fontSize:16,lineHeight:`20px`},children:e}),i.length>1&&(0,I.jsx)(`span`,{children:i.length})]},e)})}):null}function Pr({reply:e,messages:t,mine:n,name:r}){let i=t.find(t=>t.oid===e.id),a=i?i.oob?`Attachment`:i.body:e.quote?.replace(/^[^:]*: /,``)??``,o=t=>{t.stopPropagation();let n=document.querySelector(`.chat-island-root [data-oid="${CSS.escape(e.id)}"]`);n&&(n.scrollIntoView({block:`center`,behavior:`smooth`}),n.animate([{opacity:.4},{opacity:1}],{duration:900}))};return(0,I.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:o,onKeyDown:e=>e.key===`Enter`&&o(e),className:`ci-mb-1.5 ci-px-2.5 ci-py-1 ci-rounded-xl ci-cursor-pointer ci-border-0 ci-border-l-4 ci-border-solid ci-text-xs ${n?`ci-bg-black/20 dark:ci-bg-black/10 ci-border-gray-400 dark:ci-border-gray-600`:`ci-bg-black/5 dark:ci-bg-white/10 ci-border-iconSecondary dark:ci-border-iconSecondaryDark`}`,children:[(0,I.jsx)(`div`,{className:`ci-font-medium`,children:r(e.author)}),(0,I.jsx)(`div`,{className:`ci-line-clamp-2 ci-break-words ci-opacity-80`,children:a})]})}function Fr({messages:e,typing:t,onLoadOlder:n,hasOlder:r,group:i,reactions:a,me:o=``,onReact:s,onReply:c}){let l=P(e=>e.contacts),u=(0,g.useRef)(null),d=(0,g.useRef)(!0),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(null),_=e=>l[e]?.name??e;(0,g.useEffect)(()=>{let e=u.current;e&&d.current&&(e.scrollTop=e.scrollHeight)},[e.length,t,a]),(0,g.useEffect)(()=>{if(!f)return;let e=()=>p(null),t=window.setTimeout(()=>document.addEventListener(`click`,e,{once:!0}),0);return()=>{window.clearTimeout(t),document.removeEventListener(`click`,e)}},[f]);let v=()=>{let e=u.current;e&&(d.current=e.scrollHeight-e.scrollTop-e.clientHeight<40,e.scrollTop<30&&r&&n())},y=(e,t)=>{p(null),h(null),s?.(e,t)};return(0,I.jsxs)(`div`,{className:`ci-relative ci-flex-1 ci-min-h-0 ci-flex ci-flex-col`,children:[(0,I.jsxs)(`div`,{ref:u,onScroll:v,className:`ci-flex-1 ci-overflow-y-auto ci-px-4 ci-py-2 ci-space-y-1`,children:[r&&(0,I.jsx)(`div`,{className:`ci-text-center ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-py-1`,children:`Scroll up for older messages`}),e.map((t,n)=>{let r=e[n-1],u=!r||!Er(r.ts,t.ts),d=r&&!u&&r.mine===t.mine&&r.nick===t.nick&&t.ts-r.ts<12e4,m=i&&!t.mine&&t.nick?_(t.nick):null,g=t.oid,v=!!s&&!!g&&!t.pending,b=v&&(0,I.jsx)(`button`,{type:`button`,title:`React`,"aria-label":`React to this message`,onClick:e=>{e.stopPropagation(),p(f===g?null:g)},className:`ci-self-center ci-h-7 ci-w-7 ci-shrink-0 ci-flex ci-items-center ci-justify-center ci-rounded-full ci-border-0 ci-bg-transparent ci-text-gray-500 dark:ci-text-gray-400 hover:ci-bg-gray-200 dark:hover:ci-bg-gray-800 focus:ci-opacity-100 ${f===g?`ci-opacity-100`:`ci-opacity-0 group-hover:ci-opacity-100`}`,children:L.react}),x=!!c&&!!g&&!t.pending&&(0,I.jsx)(`button`,{type:`button`,title:`Reply`,"aria-label":`Reply to this message`,onClick:e=>{e.stopPropagation(),c(t)},className:`ci-self-center ci-h-7 ci-w-7 ci-shrink-0 ci-flex ci-items-center ci-justify-center ci-rounded-full ci-border-0 ci-bg-transparent ci-text-gray-500 dark:ci-text-gray-400 hover:ci-bg-gray-200 dark:hover:ci-bg-gray-800 focus:ci-opacity-100 ci-opacity-0 group-hover:ci-opacity-100`,children:L.reply});return(0,I.jsxs)(`div`,{"data-oid":t.oid,children:[u&&(0,I.jsx)(`div`,{className:`ci-text-center ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-py-2`,children:Tr(t.ts)}),(0,I.jsxs)(`div`,{className:`ci-group ci-flex ci-items-start ci-gap-1.5 ${t.mine?`ci-justify-end`:`ci-justify-start`} ${d?`ci-mt-0.5`:`ci-mt-2`}`,children:[m&&(0,I.jsx)(`span`,{className:`ci-w-7 ci-shrink-0`,title:m,children:!d&&(0,I.jsx)(ar,{contact:l[t.nick],username:t.nick,size:28})}),t.mine&&x,t.mine&&b,(0,I.jsxs)(`div`,{className:`ci-relative ci-flex ci-flex-col ci-max-w-[80%] ${t.mine?`ci-items-end`:`ci-items-start`}`,children:[f===g&&g&&(0,I.jsxs)(`div`,{role:`menu`,onClick:e=>e.stopPropagation(),className:`ci-absolute ci-bottom-full ci-mb-1 ci-z-20 ci-flex ci-items-center ci-gap-0.5 ci-p-1 ci-rounded-full ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-xl ci-ring-1 ci-ring-gray-300 dark:ci-ring-gray-700 ${t.mine?`ci-right-0`:`ci-left-0`}`,children:[vr.map(e=>(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,"aria-label":e,onClick:()=>y(g,e),style:{fontSize:22,lineHeight:`32px`},className:`ci-h-9 ci-w-9 ci-flex ci-items-center ci-justify-center ci-rounded-full ci-border-0 hover:ci-scale-125 ci-transition-transform ${a?.[g]?.[o]?.includes(e)?`ci-bg-gray-200 dark:ci-bg-gray-800`:`ci-bg-transparent`}`,children:e},e)),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,title:`More emojis`,"aria-label":`More emojis`,onClick:()=>{p(null),h(g)},className:`ci-h-8 ci-w-8 ci-flex ci-items-center ci-justify-center ci-rounded-full ci-border-0 ci-bg-gray-200 dark:ci-bg-gray-800 ci-text-gray-700 dark:ci-text-gray-200 ci-text-lg`,children:`+`})]}),(0,I.jsxs)(`div`,{title:wr(t.ts),onDoubleClick:()=>v&&y(g,vr[0]),className:`ci-px-3.5 ci-py-2 ci-rounded-3xl ci-text-sm ci-select-text ci-cursor-text ${t.mine?`ci-bg-gray-700 ci-text-gray-50 dark:ci-bg-gray-300 dark:ci-text-gray-900 ci-rounded-br-lg`:`ci-bg-elevationL2 ci-text-gray-900 dark:ci-bg-elevationL2Dark dark:ci-text-white ci-rounded-bl-lg`} ${t.pending?`ci-opacity-60`:``}`,children:[t.reply&&(0,I.jsx)(Pr,{reply:t.reply,messages:e,mine:t.mine,name:e=>e===o?`You`:_(e)}),t.oob?(0,I.jsx)(Or,{url:t.oob}):Dr(t.body)?(0,I.jsx)(Mr,{...Dr(t.body)}):(0,I.jsx)(jr,{text:t.body}),t.oob&&t.body&&t.body!==t.oob&&t.body!==Sr(t.oob)&&(0,I.jsx)(`div`,{className:`ci-text-xs ci-opacity-80 ci-mt-1`,children:t.body}),(0,I.jsx)(`span`,{className:`ci-block ci-text-right ci-text-[10px] ci-leading-none ci-opacity-60 ci-mt-1`,children:wr(t.ts)})]}),g&&(0,I.jsx)(Nr,{forMsg:a?.[g],me:o,mine:t.mine,nameOf:_,onReact:e=>v&&y(g,e)})]}),!t.mine&&b,!t.mine&&x]})]},t.id)}),t&&(0,I.jsx)(`div`,{className:`ci-flex ci-justify-start ci-mt-2`,children:(0,I.jsx)(`div`,{className:`ci-px-3.5 ci-py-2 ci-rounded-3xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-500 dark:ci-text-gray-400 ci-text-xs ci-italic`,children:`typing…`})})]}),m&&(0,I.jsx)(yr,{className:`ci-absolute ci-bottom-2 ci-left-1/2 ci--translate-x-1/2`,onPick:e=>y(m,e),onClose:()=>h(null)})]})}function Ir(e,t,n){let r=e[t];if(r===void 0)return null;let i=1;for(;i<=8&&!(r&128>>i-1);)i++;if(i>8||t+i>e.length)return null;let a=n?r:r&255>>i,o=a===255>>i;for(let n=1;n<i;n++)a=a*256+e[t+n],e[t+n]!==255&&(o=!1);return{value:a,len:i,unknown:!n&&o}}var Lr=new Set([408125543,524531317,374648427,174,225,160]);function Rr(e){let t={channels:1,packets:[]},n=0;for(;n<e.length;){let r=Ir(e,n,!0);if(!r)break;let i=Ir(e,n+r.len,!1);if(!i)break;let a=n+r.len+i.len;if(Lr.has(r.value)){n=a;continue}if(i.unknown)break;let o=Math.min(e.length,a+i.value);if(r.value===25506)t.head=e.slice(a,o);else if(r.value===159)t.channels=e[a]||1;else if(r.value===163||r.value===161){let n=Ir(e,a,!1);n&&(e[a+n.len+2]>>1&3||t.packets.push(e.slice(a+n.len+3,o)))}n=o}return t}function zr(e){if(!e.length)return 0;let t=e[0],n=t>>3,r;r=n<12?[10,20,40,60][n%4]:n<16?[10,20][n%2]:[2.5,5,10,20][n%4];let i=t&3,a=i===0?1:i===3?(e[1]??0)&63:2;return Math.round(a*r*48)}var Br=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t<<24;for(let e=0;e<8;e++)n=n&2147483648?n<<1^79764919:n<<1;e[t]=n>>>0}return e})();function Vr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<8^Br[(t>>>24^e[n])&255])>>>0;return t}function Hr(e,t,n,r,i){let a=[];for(let t of e){let e=t.length;for(;e>=255;)a.push(255),e-=255;a.push(e)}let o=e.reduce((e,t)=>e+t.length,0),s=new Uint8Array(27+a.length+o),c=new DataView(s.buffer);s.set([79,103,103,83],0),s[5]=i,c.setUint32(6,t%4294967296,!0),c.setUint32(10,Math.floor(t/4294967296),!0),c.setUint32(14,n,!0),c.setUint32(18,r,!0),s[26]=a.length,s.set(a,27);let l=27+a.length;for(let t of e)s.set(t,l),l+=t.length;return c.setUint32(22,Vr(s),!0),s}function Ur(e){let t=new Uint8Array(19),n=new DataView(t.buffer);return t.set(new TextEncoder().encode(`OpusHead`),0),t[8]=1,t[9]=e,n.setUint16(10,312,!0),n.setUint32(12,48e3,!0),t}function Wr(){let e=new TextEncoder().encode(`chat-island`),t=new Uint8Array(12+e.length+4);return t.set(new TextEncoder().encode(`OpusTags`),0),new DataView(t.buffer).setUint32(8,e.length,!0),t.set(e,12),t}function Gr(e){let{head:t,channels:n,packets:r}=Rr(e);if(!r.length)return null;let i=t&&t.length>=19&&new TextDecoder().decode(t.slice(0,8))===`OpusHead`,a=Math.random()*4294967295>>>0,o=[Hr([i?t:Ur(n)],0,a,0,2),Hr([Wr()],0,a,1,0)],s=0,c=2;for(let e=0;e<r.length;){let t=[],n=0;for(;e<r.length&&t.length<50;){let i=Math.floor(r[e].length/255)+1;if(n+i>255)break;t.push(r[e]),n+=i,s+=zr(r[e]),e++}if(!t.length)return null;o.push(Hr(t,s,a,c++,e>=r.length?4:0))}let l=o.reduce((e,t)=>e+t.length,0),u=new Uint8Array(l),d=0;for(let e of o)u.set(e,d),d+=e.length;return u}var Kr=[`audio/ogg;codecs=opus`,`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`];async function qr(e,t){let n=Date.now();if(/webm/.test(t)&&/opus/.test(t))try{let t=Gr(new Uint8Array(await new Blob(e).arrayBuffer()));if(t)return new File([t],`voice-${n}.ogg`,{type:`audio/ogg`})}catch{}return new File(e,`voice-${n}.${Jr(t)}`,{type:t.split(`;`)[0]})}var Jr=e=>/mp4/.test(e)?`m4a`:/ogg/.test(e)?`ogg`:`webm`,Yr=e=>`${Math.floor(e/6e4)}:${String(Math.floor(e%6e4/1e3)).padStart(2,`0`)}`;function Xr({onSend:e,onTyping:t,onFile:n,disabled:r,focusKey:i}){let[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),l=(0,g.useRef)(null),u=(0,g.useRef)(null),d=(0,g.useRef)(null),f=(0,g.useRef)(),p=(0,g.useRef)(!1),[m,h]=(0,g.useState)(null),[_,v]=(0,g.useState)(0),y=(0,g.useRef)(!1),b=(0,g.useRef)(!1),x=(0,g.useRef)(!1),S=(0,g.useRef)({});(0,g.useEffect)(()=>d.current?.focus(),[]),(0,g.useEffect)(()=>()=>{x.current=!0,y.current=!0,window.clearTimeout(f.current);let{r:e,stream:t}=S.current;e&&e.state!==`inactive`&&e.stop(),t?.getTracks().forEach(e=>e.stop()),S.current={}},[]),(0,g.useEffect)(()=>{if(!m)return;let e=window.setInterval(()=>v(Date.now()-m.since),250);return()=>window.clearInterval(e)},[m]),(0,g.useEffect)(()=>{i&&d.current?.focus()},[i]);let C=e=>{p.current!==e&&(p.current=e,t(e))},w=e=>{let t=e.includes(`:`)?gr(e):e;t!==e&&(l.current=Math.max(0,(d.current?.selectionStart??e.length)-(e.length-t.length))),o(t),t?(C(!0),window.clearTimeout(f.current),f.current=window.setTimeout(()=>C(!1),4e3)):C(!1)};(0,g.useLayoutEffect)(()=>{l.current!==null&&(d.current?.setSelectionRange(l.current,l.current),l.current=null)},[a]);let T=e=>{let t=d.current,n=t?.selectionStart??a.length,r=t?.selectionEnd??n;w(a.slice(0,n)+e+a.slice(r)),requestAnimationFrame(()=>{t?.focus(),t?.setSelectionRange(n+e.length,n+e.length)})},ee=()=>{let t=a.trim();t&&(o(``),Promise.resolve(e(t)).catch(()=>o(e=>e||t)),window.clearTimeout(f.current),p.current=!1)},te=async()=>{if(b.current||m)return;b.current=!0;let e;try{e=await navigator.mediaDevices.getUserMedia({audio:!0});let t=e;if(x.current){t.getTracks().forEach(e=>e.stop());return}let r=Kr.find(e=>MediaRecorder.isTypeSupported(e)),i=new MediaRecorder(e,r?{mimeType:r}:void 0),a=[];i.ondataavailable=e=>e.data.size&&a.push(e.data),i.onstop=()=>{t.getTracks().forEach(e=>e.stop()),S.current={},h(null),!y.current&&a.length&&qr(a,i.mimeType||r||``).then(n)},y.current=!1,i.start(),S.current={r:i,stream:t},v(0),h({r:i,since:Date.now()})}catch{e?.getTracks().forEach(e=>e.stop())}finally{b.current=!1}},ne=e=>{y.current=e,m?.r.stop()};return m?(0,I.jsxs)(`div`,{className:`ci-flex ci-items-center ci-gap-2 ci-px-3 ci-py-3`,children:[(0,I.jsx)(ur,{variant:`transparent`,title:`Discard`,"aria-label":`Discard`,onClick:()=>ne(!0),className:`ci-h-10 ci-w-10`,children:L.close}),(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-flex ci-items-center ci-gap-2 ci-px-4 ci-py-2.5 ci-rounded-3xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-sm`,children:[(0,I.jsx)(`span`,{className:`ci-w-2.5 ci-h-2.5 ci-rounded-full ci-bg-phoneIslandClose dark:ci-bg-phoneIslandCloseDark ci-animate-pulse`}),(0,I.jsxs)(`span`,{children:[`Recording `,Yr(_)]})]}),(0,I.jsx)(ur,{variant:`green`,title:`Send voice note`,"aria-label":`Send voice note`,onClick:()=>ne(!1),className:`ci-h-10 ci-w-10`,children:L.send})]}):(0,I.jsxs)(`div`,{className:`ci-relative ci-flex ci-items-center ci-gap-2 ci-px-3 ci-py-3`,children:[s&&(0,I.jsx)(yr,{className:`ci-absolute ci-bottom-full ci-left-3 ci-mb-1`,onPick:T,onClose:()=>c(!1)}),(0,I.jsx)(`input`,{ref:u,type:`file`,hidden:!0,onChange:e=>e.target.files?.[0]&&(n(e.target.files[0]),e.target.value=``)}),(0,I.jsx)(ur,{variant:`transparent`,disabled:r,title:`Attach a file`,onClick:()=>u.current?.click(),className:`ci-h-10 ci-w-10`,children:L.clip}),(0,I.jsxs)(`div`,{className:`ci-relative ci-flex-1 ci-min-w-0`,children:[(0,I.jsx)(`button`,{type:`button`,disabled:r,title:`Emoji`,"aria-label":`Emoji`,"aria-expanded":s,onClick:()=>c(e=>!e),className:`ci-absolute ci-left-2 ci-bottom-1 ci-z-10 ci-h-8 ci-w-8 ci-flex ci-items-center ci-justify-center ci-rounded-full ci-border-0 ci-bg-transparent ci-text-secondaryNeutral dark:ci-text-secondaryNeutralDark hover:ci-bg-gray-300/70 dark:hover:ci-bg-gray-700/30 disabled:ci-opacity-40`,children:L.smile}),(0,I.jsx)(`textarea`,{ref:d,value:a,disabled:r,rows:1,placeholder:r?`Connecting…`:`Write a message`,onChange:e=>w(e.target.value),onKeyDown:e=>{let t=(a.match(/```/g)??[]).length%2==1;e.key===`Enter`&&!e.shiftKey&&!t&&(e.preventDefault(),ee())},className:`ci-block ci-w-full ci-resize-none ci-max-h-32 ci-pl-11 ci-pr-4 ci-py-2.5 ci-rounded-3xl ci-border-0 ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400 ci-outline-none focus:ci-ring-2 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500 ci-text-sm`,style:{height:Math.min(128,40+20*(a.split(`
|
|
9
|
-
`).length-1))}})]}),a.trim()?(0,I.jsx)(ur,{variant:`default`,disabled:r,onClick:ee,title:`Send`,className:`ci-h-10 ci-w-10`,children:L.send}):(0,I.jsx)(ur,{variant:`default`,disabled:r||typeof MediaRecorder>`u`,onClick:te,title:`Record a voice note`,"aria-label":`Record a voice note`,className:`ci-h-10 ci-w-10`,children:L.mic})]})}var Zr=e=>!!e&&![`offline`,`dnd`,`busy`,`ringing`,`onhold`].includes(e);function Qr({peer:e,actions:t,onDragStart:n}){let{c:r,contacts:i,online:a,mobile:o,status:s,closeChat:c,openChat:l,markRead:u,order:d,me:f}=P(y(t=>({c:t.conversations[e],contacts:t.contacts,online:t.online,mobile:t.mobile,status:t.status,closeChat:t.closeChat,openChat:t.openChat,markRead:t.markRead,order:t.order,me:t.me}))),p=Math.max(0,d.indexOf(e)),m=i[e],[h,_]=(0,g.useState)(!1),[v,b]=(0,g.useState)(null),[x,S]=(0,g.useState)(0),C=e=>e===f?`You`:i[e]?.name??e,w=[...r?.members??[]].sort((e,t)=>Number(e===f)-Number(t===f));(0,g.useEffect)(()=>{r&&!r.loaded&&t.loadOlder(e)},[e,r?.loaded]),(0,g.useEffect)(()=>{u(e)},[e,r?.messages.length]),(0,g.useEffect)(()=>{_(!1),b(null)},[e]);let T=t=>{if(!t.oid)return;let n=r?.kind===`group`?t.nick??``:t.mine?f:e,a=t.oob?`Attachment`:t.body.replace(/```/g,``).replace(/\s+/g,` `).trim().slice(0,100),o=n===f?P.getState().myName||f:i[n]?.name??n;b({id:t.oid,author:n,quote:`${o}: ${a}`}),S(e=>e+1)};return r?(0,I.jsxs)(`div`,{role:`dialog`,"aria-label":r.kind===`group`?r.name??e:m?.name??e,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),v?b(null):h?_(!1):c())},className:`ci-relative ci-w-[22rem] ci-h-[30rem] ci-flex ci-flex-col ci-rounded-3xl ci-shadow-2xl ci-bg-gray-50 dark:ci-bg-gray-950 ci-text-gray-900 dark:ci-text-white`,children:[(0,I.jsx)(`span`,{className:`ci-absolute ci--right-1.5 ci-w-3 ci-h-3 ci-rotate-45 ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-2xl ci-transition-all ci-duration-200`,style:{bottom:`calc(1.875rem + ${p} * 3.75rem)`},"aria-hidden":`true`}),(0,I.jsxs)(`div`,{className:`ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-3 ci-rounded-t-3xl ${n?`ci-cursor-grab active:ci-cursor-grabbing ci-touch-none`:``}`,onPointerDown:n,children:[r.kind===`group`?(0,I.jsx)(sr,{name:r.name??e,size:36,avatar:r.avatar}):(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:m,username:e,size:36}),(0,I.jsx)(or,{online:a[e],presence:m?.presence,mobile:o[e]})]}),(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-w-0 ${r.kind===`group`?`ci-cursor-pointer`:``}`,...r.kind===`group`?{role:`button`,tabIndex:0,"aria-expanded":h,onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e=>!e))}:{},onClick:()=>r.kind===`group`&&_(e=>!e),children:[(0,I.jsx)(`div`,{className:`ci-font-medium ci-truncate ci-text-sm`,children:r.kind===`group`?r.name??e:m?.name??e}),(0,I.jsx)(`div`,{className:`ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-truncate`,children:s===`online`?r.kind===`group`?w.map(C).join(`, `):r.typing?`typing…`:a[e]?`online`:o[e]?`Mobile`:`offline`:s})]}),r.kind!==`group`&&m?.number&&Zr(m.presence)&&(0,I.jsx)(ur,{variant:`call`,title:`Call ${m.number}`,"aria-label":`Call`,onClick:()=>F(`chat-island-call`,{username:e,number:m.number}),children:L.phone}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>c(),"aria-label":`Minimize`,title:`Minimize`,children:L.minus})]}),(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700`}),h&&r.kind===`group`&&(0,I.jsx)(`div`,{className:`ci-absolute ci-left-3 ci-right-3 ci-top-16 ci-z-10 ci-max-h-64 ci-overflow-y-auto ci-rounded-2xl ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-2xl ci-ring-1 ci-ring-gray-300 dark:ci-ring-gray-700 ci-p-2`,children:w.map(e=>(0,I.jsxs)(`div`,{className:`ci-flex ci-items-center ci-gap-3 ci-px-2 ci-py-1.5 ci-text-sm`,children:[(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:i[e],username:e,size:28}),e!==f&&(0,I.jsx)(or,{online:a[e],presence:i[e]?.presence,mobile:o[e]})]}),(0,I.jsx)(`span`,{className:`ci-truncate ci-flex-1`,children:C(e)}),e!==f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ur,{variant:`small`,title:`Chat`,"aria-label":`Chat`,onClick:()=>l(e),children:L.chat}),i[e]?.number&&Zr(i[e]?.presence)&&(0,I.jsx)(ur,{variant:`call`,title:`Call ${i[e]?.number}`,"aria-label":`Call`,onClick:()=>F(`chat-island-call`,{username:e,number:i[e].number}),children:L.phone})]})]},e))}),(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-h-0 ci-flex ci-flex-col ci-overflow-hidden ci-rounded-b-3xl`,children:[(0,I.jsx)(Fr,{messages:r.messages,typing:r.typing,group:r.kind===`group`,hasOlder:r.loaded&&!r.complete,onLoadOlder:()=>t.loadOlder(e),reactions:r.reactions,me:f,onReact:(n,r)=>t.react(e,n,r),onReply:T}),v&&(0,I.jsxs)(`div`,{className:`ci-mx-3 ci-mt-1 ci-flex ci-items-center ci-gap-2 ci-pl-3 ci-pr-1 ci-py-1.5 ci-rounded-2xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-border-0 ci-border-l-4 ci-border-solid ci-border-iconSecondary dark:ci-border-iconSecondaryDark`,children:[(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-w-0 ci-text-xs`,children:[(0,I.jsx)(`div`,{className:`ci-font-medium ci-text-gray-900 dark:ci-text-white`,children:v.author===f?`You`:i[v.author]?.name??v.author}),(0,I.jsx)(`div`,{className:`ci-truncate ci-text-gray-500 dark:ci-text-gray-400`,children:v.quote?.replace(/^[^:]*: /,``)})]}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>b(null),"aria-label":`Cancel reply`,title:`Cancel reply`,children:L.close})]}),(0,I.jsx)(Xr,{focusKey:x,disabled:s!==`online`,onSend:n=>t.send(e,n,v??void 0).then(()=>b(null)),onTyping:n=>t.typing(e,n),onFile:n=>t.upload(e,n)},e)]})]}):null}async function $r(e){let t=await createImageBitmap(e),n=Math.min(t.width,t.height),r=document.createElement(`canvas`);return r.width=r.height=128,r.getContext(`2d`)?.drawImage(t,(t.width-n)/2,(t.height-n)/2,n,n,0,0,128,128),r.toDataURL(`image/jpeg`,.8)}function ei({onOpen:e,onCreateGroup:t}){let{contacts:n,online:r,mobile:i,setPicker:a}=P(),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)([]),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(!1),[m,h]=(0,g.useState)(),_=(0,g.useRef)(null),v=(0,g.useMemo)(()=>{let e=Object.values(n),t=o.trim().toLowerCase();return t?e.filter(e=>(e.name??``).toLowerCase().includes(t)||e.username.includes(t)):e},[n,o]),y=e=>l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),b=async()=>{p(!0);try{await t(u.trim(),c,m)}finally{p(!1)}};return(0,I.jsxs)(`div`,{className:`ci-w-[22rem] ci-max-h-[30rem] ci-flex ci-flex-col ci-rounded-3xl ci-shadow-2xl ci-overflow-hidden ci-bg-gray-50 dark:ci-bg-gray-950 ci-text-gray-900 dark:ci-text-white`,children:[(0,I.jsxs)(`div`,{className:`ci-px-4 ci-py-3 ci-flex ci-items-center ci-gap-2`,children:[(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-flex ci-items-center ci-gap-2 ci-px-4 ci-py-2 ci-rounded-3xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-500 dark:ci-text-gray-400`,children:[L.search,(0,I.jsx)(`input`,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:`Search colleagues`,className:`ci-flex-1 ci-bg-transparent ci-border-0 ci-outline-none ci-text-sm ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400`})]}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>a(!1),"aria-label":`Close`,children:L.close})]}),c.length>0&&(0,I.jsx)(`div`,{className:`ci-px-4 ci-pb-2 ci-flex ci-flex-wrap ci-gap-1.5`,children:c.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>y(e),className:`ci-flex ci-items-center ci-gap-1 ci-pl-2.5 ci-pr-1.5 ci-py-1 ci-rounded-full ci-text-xs ci-bg-gray-700 ci-text-gray-50 dark:ci-bg-gray-300 dark:ci-text-gray-900 ci-border-0`,children:[n[e]?.name??e,L.close]},e))}),(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700`}),(0,I.jsxs)(`ul`,{className:`ci-overflow-y-auto ci-py-1 ci-m-0 ci-p-0 ci-list-none ci-flex-1`,children:[v.length===0&&(0,I.jsx)(`li`,{className:`ci-px-4 ci-py-6 ci-text-center ci-text-sm ci-text-gray-500 dark:ci-text-gray-400`,children:`No colleagues found`}),v.map(e=>{let t=c.includes(e.username);return(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>y(e.username),className:`ci-w-full ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-2 ci-bg-transparent ci-border-0 ci-text-left hover:ci-bg-gray-300/70 dark:hover:ci-bg-gray-700/30 ci-text-inherit`,children:[(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:e,username:e.username,size:36}),(0,I.jsx)(or,{online:r[e.username],presence:e.presence,mobile:i[e.username]})]}),(0,I.jsxs)(`span`,{className:`ci-flex ci-flex-col ci-min-w-0 ci-flex-1`,children:[(0,I.jsx)(`span`,{className:`ci-text-sm ci-font-medium ci-truncate`,children:e.name}),(0,I.jsx)(`span`,{className:`ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-truncate`,children:e.username})]}),(0,I.jsx)(`span`,{className:`ci-w-5 ci-h-5 ci-rounded-full ci-border ci-flex ci-items-center ci-justify-center ${t?`ci-bg-phoneIslandCall dark:ci-bg-phoneIslandCallDark ci-border-transparent ci-text-white dark:ci-text-gray-950`:`ci-border-gray-400 dark:ci-border-gray-600`}`,children:t&&(0,I.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})})]})},e.username)})]}),c.length>0&&(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700 ci-px-4 ci-py-3 ci-flex ci-items-center ci-gap-2`,children:c.length===1?(0,I.jsx)(ur,{variant:`default`,className:`ci-w-auto ci-h-10 ci-px-5`,onClick:()=>e(c[0]),children:`Open chat`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`input`,{ref:_,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>e.target.files?.[0]&&$r(e.target.files[0]).then(h).catch(()=>{})}),(0,I.jsx)(`button`,{type:`button`,title:`Group picture`,onClick:()=>_.current?.click(),className:`ci-w-10 ci-h-10 ci-shrink-0 ci-rounded-full ci-border-0 ci-p-0 ci-overflow-hidden ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-500 dark:ci-text-gray-400 ci-flex ci-items-center ci-justify-center`,children:m?(0,I.jsx)(`img`,{src:m,alt:``,draggable:!1,className:`ci-w-full ci-h-full ci-object-cover`}):L.camera}),(0,I.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Group name`,onKeyDown:e=>e.key===`Enter`&&u.trim()&&!f&&b(),className:`ci-flex-1 ci-min-w-0 ci-w-0 ci-px-4 ci-py-2 ci-rounded-3xl ci-border-0 ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-sm ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400 ci-outline-none focus:ci-ring-2 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500`}),(0,I.jsx)(ur,{variant:`green`,className:`ci-w-auto ci-h-10 ci-px-4 ci-shrink-0 ci-whitespace-nowrap`,disabled:!u.trim()||f,onClick:b,children:f?`…`:`Create group`})]})})]})}var ti=`chat-island-theme`,ni=()=>{try{let e=localStorage.getItem(ti);return e===`light`||e===`dark`||e===`system`?e:void 0}catch{return}};function ri(e){let[t,n]=(0,g.useState)(()=>e??ni()),[r,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>n(e??ni()),[e]),(0,g.useEffect)(()=>{let e=e=>{let t=e.detail?.theme;if(t===`light`||t===`dark`||t===`system`){try{localStorage.setItem(ti,t)}catch{}n(t)}};return window.addEventListener(`chat-island-theme-change`,e),()=>window.removeEventListener(`chat-island-theme-change`,e)},[]),(0,g.useEffect)(()=>{if(t===`light`||t===`dark`){i(t===`dark`);return}if(t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>i(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}let e=document.documentElement,n=()=>i(e.classList.contains(`dark`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>r.disconnect()},[t]),r}function ii(){let e=P.getState();return Object.values(e.conversations).map(t=>{let n=t.messages[t.messages.length-1],r=e.contacts[t.peer];return{peer:t.peer,kind:t.kind,name:t.kind===`group`?t.name??t.peer.split(`@`)[0]:r?.name??t.peer,avatar:t.kind===`group`?t.avatar:r?.avatar,online:t.kind!==`group`&&!!e.online[t.peer],mobile:t.kind!==`group`&&!!e.mobile[t.peer],owner:t.kind===`group`?!!t.owner:void 0,unread:t.unread,members:t.members,last:n?{body:si(n.body),ts:n.ts,mine:n.mine,oob:n.oob,nick:n.nick}:void 0}}).filter(e=>e.last||e.kind===`group`).sort((e,t)=>(t.last?.ts??0)-(e.last?.ts??0))}var ai=class extends g.Component{state={failed:!1};failures=[];static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){F(`chat-island-error`,{scope:`render`,message:e.message});let t=Date.now();this.failures=[...this.failures.filter(e=>t-e<1e4),t],!(this.failures.length>=3)&&(P.getState().closeChat(),window.setTimeout(()=>this.setState({failed:!1}),0))}render(){return this.state.failed?null:this.props.children}};function oi(e){try{let[t,n,r]=atob(e).split(`:`);return t&&n&&r?{host:t,username:n,token:r}:null}catch{return null}}var si=e=>(Dr(e)?`Attachment`:gr(e)).replace(/```[^\n]*\n?/g,``).replace(/(\*\*|__|~~|`)/g,``).replace(/(^|\s)[*_](\S[^*_]*)[*_]/g,`$1$2`).replace(/\s+/g,` `).trim();function ci({dataConfig:e,position:t=`bottom-right`,theme:n,serviceWorker:r,maxHeads:i=5,newChatButton:a=!0,notifications:o=`click`,sound:s=!0,drag:c=!0,onDragStart:l}){let u=(0,g.useMemo)(()=>oi(e),[e]),d=ri(n),f=(0,g.useRef)(u),p=(0,g.useRef)(s),m=(0,g.useRef)(o);(0,g.useEffect)(()=>{f.current=u,p.current=s,m.current=o},[u,s,o]),(0,g.useEffect)(()=>P.setState({maxHeads:i,newChatButton:a}),[i,a]);let[h,_]=(0,g.useState)(0);(0,g.useEffect)(()=>{let e=e=>e.persisted&&_(e=>e+1);return window.addEventListener(`pageshow`,e),()=>window.removeEventListener(`pageshow`,e)},[]);let v=(0,g.useRef)(null),b=(0,g.useRef)(new Set),S=(0,g.useRef)(!1),C=(0,g.useRef)(null),w=(0,g.useRef)(null),T=x(w,`chat-island-pos:${u?.host??``}:${u?.username??``}`),{open:ee,picker:te,status:ne}=P(y(e=>({open:e.open,picker:e.picker,status:e.status}))),re=(0,g.useMemo)(()=>({send:async(e,t,n)=>{let r=v.current;if(!r)throw Error(`not connected`);try{P.getState().addMessage(e,await r.send(e,gr(t),void 0,n))}catch(e){throw F(`chat-island-error`,{scope:`send`,message:e.message}),e}},typing:(e,t)=>P.getState().online[e]&&v.current?.typing(e,t).catch(()=>{}),upload:async(e,t)=>{let n=v.current;if(n)try{let r=await n.upload(t);P.getState().addMessage(e,await n.send(e,t.name,r))}catch(e){F(`chat-island-error`,{scope:`upload`,message:e.message})}},createGroup:async(e,t,n)=>{let r=v.current,i=f.current;if(r&&i)try{let a=await r.createGroup(e,t,n),o=P.getState();o.setGroup(a,e,[...t,i.username],n),o.openChat(a)}catch(e){F(`chat-island-error`,{scope:`group`,message:e.message})}},remove:async e=>{let t=v.current,n=f.current;if(!t||!n)return;let r=P.getState().conversations[e];try{r?.kind===`group`&&await t.leaveGroup(e,!!r.owner).catch(()=>{}),await Zn(n.host,n.token,e),P.getState().removeConversation(e)}catch(e){F(`chat-island-error`,{scope:`delete`,message:e.message})}},react:async(e,t,n)=>{let r=v.current,i=f.current?.username;if(!r||!i)return;let a=(P.getState().conversations[e]?.reactions?.[t]?.[i]??[]).includes(n)?[]:[n];try{await r.react(e,t,a),P.getState().applyReactions([{peer:e,target:t,user:i,emojis:a}])}catch(e){F(`chat-island-error`,{scope:`reaction`,message:e.message})}},loadOlder:async e=>{let t=v.current,n=P.getState().ensure(e);if(!(!t||n.complete||b.current.has(e))){b.current.add(e);try{let r=await t.history(e,n.oldest);P.getState().prependHistory(e,r.messages,r.complete,r.first),P.getState().applyReactions(r.reactions)}catch(e){F(`chat-island-error`,{scope:`history`,message:e.message})}finally{b.current.delete(e)}}}}),[]);(0,g.useEffect)(()=>{if(!u)return;let e=P.getState();e.reset(),P.setState({me:u.username,mucHost:`conference.${u.host}`,maxHeads:i,newChatButton:a});let t=new Cn(u,{status:(n,i)=>{if(e.setStatus(n,i),F(`chat-island-status`,{status:n,error:i}),n===`online`&&r&&!S.current&&typeof Notification<`u`){let e=Notification.permission;(e===`granted`||m.current===`auto`&&e==="default")&&o()}n===`online`&&t.listGroups().then(t=>t.forEach(t=>e.setGroup(t.peer,t.name,t.members,t.avatar,t.owner))).catch(()=>{}).then(()=>t.recent()).then(e=>{e&&(P.getState().seed(e.messages,u.username),P.getState().applyReactions(e.reactions))}).catch(()=>{})},typing:(t,n)=>e.setTyping(t,n),reaction:t=>e.applyReactions([t]),presence:(t,n)=>e.setOnline(t,n),groupDestroyed:t=>e.removeConversation(t),groupInvite:n=>{t.subscribed(n).then(async r=>{if(!r)return;let i=await t.groupInfo(n);e.setGroup(i.peer,i.name,i.members,i.avatar,i.owner)}).catch(()=>{})},message:r=>{let i=Wn(r);r.room&&!P.getState().conversations[r.room]?.name&&t.groupInfo(r.room).then(t=>e.setGroup(t.peer,t.name,t.members,t.avatar,t.owner)).catch(()=>{}),e.addMessage(i,r,{live:!0}),F(`chat-island-message`,{...r,peer:i}),F(`chat-island-unread`,{total:P.getState().totalUnread()}),r.mine||n(i,r)}}),n=(e,t)=>{let n=P.getState(),r=document.visibilityState===`visible`;if(r&&n.open===e)return;let i=n.conversations[e],a=i?.kind===`group`?i.name??e:n.contacts[e]?.name??e,o=t.oob?`Attachment`:gr(t.body),s=i?.kind===`group`,c=s&&t.nick?n.contacts[t.nick]?.name??t.nick:a,l=s&&t.nick?`${c}: ${o}`:o;p.current&&jn();let u=s?i?.avatar:n.contacts[e]?.avatar;if(F(`chat-island-notify`,{peer:e,name:a,body:l,kind:s?`group`:`chat`,author:c,text:o,attachment:!!t.oob,avatar:u,ts:t.ts}),!r&&typeof Notification<`u`&&Notification.permission===`granted`)try{let t=new Notification(a,{body:l,tag:`chat-${e}`});t.onclick=()=>{window.focus(),P.getState().openChat(e),t.close()}}catch{}};v.current=t;let o=()=>{r&&!S.current&&(S.current=!0,tr(u,r).then(e=>{if(!e){S.current=!1,P.setState({push:Notification.permission===`denied`?`denied`:`ask`});return}return t.enablePush(e.service,e.node).then(()=>{C.current=e,P.setState({push:`enabled`}),F(`chat-island-push`,{enabled:!0})})}).catch(e=>{S.current=!1,F(`chat-island-error`,{scope:`push`,message:e.message})}))},s=!!r&&`serviceWorker`in navigator&&`PushManager`in window&&typeof Notification<`u`;P.setState({push:s?Notification.permission===`denied`?`denied`:`ask`:`unavailable`,enablePush:o});let c=()=>t.stop();window.addEventListener(`pagehide`,c),t.start();let l=()=>Xn(u.host,u.token).then(e.setMobile).catch(()=>{});l();let d=window.setInterval(l,12e4);Yn(u.host,u.token,u.username,e=>P.setState({myName:e})).then(e.setContacts).catch(e=>F(`chat-island-error`,{scope:`contacts`,message:e.message}));let f=nr(`chat-island-open`,({username:t})=>t&&e.openChat(t)),h=nr(`chat-island-close`,()=>e.closeChat()),g=nr(`chat-island-new`,()=>e.setPicker(!0)),_=nr(`chat-island-delete`,({username:e})=>e&&re.remove(e)),y=nr(`chat-island-contacts`,({contacts:t})=>t&&e.setContacts(t)),b=nr(`chat-island-conversations-request`,()=>F(`chat-island-conversations`,{conversations:ii()}));return()=>{window.removeEventListener(`pagehide`,c),window.clearInterval(d),b(),g(),_(),f(),h(),y(),C.current&&t.disablePush(C.current.service,C.current.node).catch(()=>{}),C.current=null,t.stop(),v.current=null,S.current=!1}},[u,r,h]);let ie=P(e=>Object.keys(e.contacts).join(`,`));(0,g.useEffect)(()=>{ne===`online`&&ie&&v.current?.announce(ie.split(`,`))},[ne,ie]);let ae=P(e=>Object.values(e.conversations).map(e=>`${e.peer}:${e.kind}:${e.name??``}:${(e.members??[]).length}:${e.unread}:${e.messages[e.messages.length-1]?.id??``}`).join(`|`)+`#`+Object.keys(e.contacts).length+`#`+Object.values(e.online).filter(Boolean).length);(0,g.useEffect)(()=>F(`chat-island-conversations`,{conversations:ii()}),[ae]);let oe=P(e=>Object.values(e.conversations).reduce((e,t)=>e+t.unread,0));if((0,g.useEffect)(()=>F(`chat-island-unread`,{total:oe}),[oe]),!u)return null;let se=c&&!l&&T.anchor?{right:T.anchor.right,bottom:T.anchor.bottom}:void 0,E=se?``:t===`bottom-left`?`ci-left-4 ci-bottom-5`:`ci-right-4 ci-bottom-5`;return(0,I.jsx)(`div`,{ref:w,style:se,onClickCapture:T.onClickCapture,className:`chat-island-root ${d?`ci-dark`:``} ci-fixed ${E} ci-z-[9999] ci-flex ci-items-end ci-gap-3 ci-font-sans ci-select-none`,"data-status":ne,children:(0,I.jsxs)(ai,{children:[ee&&(0,I.jsx)(Qr,{peer:ee,actions:re,onDragStart:l??(c?T.start:void 0)}),te&&(0,I.jsx)(ei,{onOpen:e=>P.getState().openChat(e),onCreateGroup:re.createGroup}),(0,I.jsx)(dr,{onDragStart:l??(c?T.start:void 0),pushButton:o!==`auto`})]})})}document.querySelectorAll(`.chat-island`).forEach(e=>{(0,h.createRoot)(e).render((0,I.jsx)(g.StrictMode,{children:(0,I.jsx)(ci,{dataConfig:e.dataset.config??``,position:e.dataset.position===`bottom-left`?`bottom-left`:`bottom-right`,theme:e.dataset.theme,serviceWorker:e.dataset.serviceWorker})}))})})();
|
|
9
|
+
`).length-1))}})]}),a.trim()?(0,I.jsx)(ur,{variant:`default`,disabled:r,onClick:ee,title:`Send`,className:`ci-h-10 ci-w-10`,children:L.send}):(0,I.jsx)(ur,{variant:`default`,disabled:r||typeof MediaRecorder>`u`,onClick:te,title:`Record a voice note`,"aria-label":`Record a voice note`,className:`ci-h-10 ci-w-10`,children:L.mic})]})}var Zr=e=>!!e&&![`offline`,`dnd`,`busy`,`ringing`,`onhold`].includes(e);function Qr({peer:e,actions:t,onDragStart:n}){let{c:r,contacts:i,online:a,mobile:o,status:s,closeChat:c,openChat:l,markRead:u,order:d,me:f}=P(y(t=>({c:t.conversations[e],contacts:t.contacts,online:t.online,mobile:t.mobile,status:t.status,closeChat:t.closeChat,openChat:t.openChat,markRead:t.markRead,order:t.order,me:t.me}))),p=Math.max(0,d.indexOf(e)),m=i[e],[h,_]=(0,g.useState)(!1),[v,b]=(0,g.useState)(null),[x,S]=(0,g.useState)(0),C=e=>e===f?`You`:i[e]?.name??e,w=[...r?.members??[]].sort((e,t)=>Number(e===f)-Number(t===f));(0,g.useEffect)(()=>{r&&!r.loaded&&t.loadOlder(e)},[e,r?.loaded]),(0,g.useEffect)(()=>{u(e)},[e,r?.messages.length]),(0,g.useEffect)(()=>{_(!1),b(null)},[e]);let T=t=>{if(!t.oid)return;let n=r?.kind===`group`?t.nick??``:t.mine?f:e,a=t.oob?`Attachment`:t.body.replace(/```/g,``).replace(/\s+/g,` `).trim().slice(0,100),o=n===f?P.getState().myName||f:i[n]?.name??n;b({id:t.oid,author:n,quote:`${o}: ${a}`}),S(e=>e+1)};return r?(0,I.jsxs)(`div`,{role:`dialog`,"aria-label":r.kind===`group`?r.name??e:m?.name??e,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),v?b(null):h?_(!1):c())},className:`ci-relative ci-w-[22rem] ci-h-[30rem] ci-flex ci-flex-col ci-rounded-3xl ci-shadow-2xl ci-bg-gray-50 dark:ci-bg-gray-950 ci-text-gray-900 dark:ci-text-white`,children:[(0,I.jsx)(`span`,{className:`ci-absolute ci--right-1.5 ci-w-3 ci-h-3 ci-rotate-45 ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-2xl ci-transition-all ci-duration-200`,style:{bottom:`calc(1.875rem + ${p} * 3.75rem)`},"aria-hidden":`true`}),(0,I.jsxs)(`div`,{className:`ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-3 ci-rounded-t-3xl ${n?`ci-cursor-grab active:ci-cursor-grabbing ci-touch-none`:``}`,onPointerDown:n,children:[r.kind===`group`?(0,I.jsx)(sr,{name:r.name??e,size:36,avatar:r.avatar}):(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:m,username:e,size:36}),(0,I.jsx)(or,{online:a[e],presence:m?.presence,mobile:o[e]})]}),(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-w-0 ${r.kind===`group`?`ci-cursor-pointer`:``}`,...r.kind===`group`?{role:`button`,tabIndex:0,"aria-expanded":h,onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e=>!e))}:{},onClick:()=>r.kind===`group`&&_(e=>!e),children:[(0,I.jsx)(`div`,{className:`ci-font-medium ci-truncate ci-text-sm`,children:r.kind===`group`?r.name??e:m?.name??e}),(0,I.jsx)(`div`,{className:`ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-truncate`,children:s===`online`?r.kind===`group`?w.map(C).join(`, `):r.typing?`typing…`:a[e]?`online`:o[e]?`Mobile`:`offline`:s})]}),r.kind!==`group`&&m?.number&&Zr(m.presence)&&(0,I.jsx)(ur,{variant:`call`,title:`Call ${m.number}`,"aria-label":`Call`,onClick:()=>F(`chat-island-call`,{username:e,number:m.number}),children:L.phone}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>c(),"aria-label":`Minimize`,title:`Minimize`,children:L.minus})]}),(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700`}),h&&r.kind===`group`&&(0,I.jsx)(`div`,{className:`ci-absolute ci-left-3 ci-right-3 ci-top-16 ci-z-10 ci-max-h-64 ci-overflow-y-auto ci-rounded-2xl ci-bg-gray-50 dark:ci-bg-gray-950 ci-shadow-2xl ci-ring-1 ci-ring-gray-300 dark:ci-ring-gray-700 ci-p-2`,children:w.map(e=>(0,I.jsxs)(`div`,{className:`ci-flex ci-items-center ci-gap-3 ci-px-2 ci-py-1.5 ci-text-sm`,children:[(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:i[e],username:e,size:28}),e!==f&&(0,I.jsx)(or,{online:a[e],presence:i[e]?.presence,mobile:o[e]})]}),(0,I.jsx)(`span`,{className:`ci-truncate ci-flex-1`,children:C(e)}),e!==f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ur,{variant:`small`,title:`Chat`,"aria-label":`Chat`,onClick:()=>l(e),children:L.chat}),i[e]?.number&&Zr(i[e]?.presence)&&(0,I.jsx)(ur,{variant:`call`,title:`Call ${i[e]?.number}`,"aria-label":`Call`,onClick:()=>F(`chat-island-call`,{username:e,number:i[e].number}),children:L.phone})]})]},e))}),(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-h-0 ci-flex ci-flex-col ci-overflow-hidden ci-rounded-b-3xl`,children:[(0,I.jsx)(Fr,{messages:r.messages,typing:r.typing,group:r.kind===`group`,hasOlder:r.loaded&&!r.complete,onLoadOlder:()=>t.loadOlder(e),reactions:r.reactions,me:f,onReact:(n,r)=>t.react(e,n,r),onReply:T}),v&&(0,I.jsxs)(`div`,{className:`ci-mx-3 ci-mt-1 ci-flex ci-items-center ci-gap-2 ci-pl-3 ci-pr-1 ci-py-1.5 ci-rounded-2xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-border-0 ci-border-l-4 ci-border-solid ci-border-iconSecondary dark:ci-border-iconSecondaryDark`,children:[(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-min-w-0 ci-text-xs`,children:[(0,I.jsx)(`div`,{className:`ci-font-medium ci-text-gray-900 dark:ci-text-white`,children:v.author===f?`You`:i[v.author]?.name??v.author}),(0,I.jsx)(`div`,{className:`ci-truncate ci-text-gray-500 dark:ci-text-gray-400`,children:v.quote?.replace(/^[^:]*: /,``)})]}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>b(null),"aria-label":`Cancel reply`,title:`Cancel reply`,children:L.close})]}),(0,I.jsx)(Xr,{focusKey:x,disabled:s!==`online`,onSend:n=>t.send(e,n,v??void 0).then(()=>b(null)),onTyping:n=>t.typing(e,n),onFile:n=>t.upload(e,n)},e)]})]}):null}async function $r(e){let t=await createImageBitmap(e),n=Math.min(t.width,t.height),r=document.createElement(`canvas`);return r.width=r.height=128,r.getContext(`2d`)?.drawImage(t,(t.width-n)/2,(t.height-n)/2,n,n,0,0,128,128),r.toDataURL(`image/jpeg`,.8)}function ei({onOpen:e,onCreateGroup:t}){let{contacts:n,online:r,mobile:i,setPicker:a}=P(),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)([]),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(!1),[m,h]=(0,g.useState)(),_=(0,g.useRef)(null),v=(0,g.useMemo)(()=>{let e=Object.values(n),t=o.trim().toLowerCase();return t?e.filter(e=>(e.name??``).toLowerCase().includes(t)||e.username.includes(t)):e},[n,o]),y=e=>l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),b=async()=>{p(!0);try{await t(u.trim(),c,m)}finally{p(!1)}};return(0,I.jsxs)(`div`,{className:`ci-w-[22rem] ci-max-h-[30rem] ci-flex ci-flex-col ci-rounded-3xl ci-shadow-2xl ci-overflow-hidden ci-bg-gray-50 dark:ci-bg-gray-950 ci-text-gray-900 dark:ci-text-white`,children:[(0,I.jsxs)(`div`,{className:`ci-px-4 ci-py-3 ci-flex ci-items-center ci-gap-2`,children:[(0,I.jsxs)(`div`,{className:`ci-flex-1 ci-flex ci-items-center ci-gap-2 ci-px-4 ci-py-2 ci-rounded-3xl ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-500 dark:ci-text-gray-400`,children:[L.search,(0,I.jsx)(`input`,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:`Search operators`,className:`ci-flex-1 ci-bg-transparent ci-border-0 ci-outline-none ci-text-sm ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400`})]}),(0,I.jsx)(ur,{variant:`small`,onClick:()=>a(!1),"aria-label":`Close`,children:L.close})]}),c.length>0&&(0,I.jsx)(`div`,{className:`ci-px-4 ci-pb-2 ci-flex ci-flex-wrap ci-gap-1.5`,children:c.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>y(e),className:`ci-flex ci-items-center ci-gap-1 ci-pl-2.5 ci-pr-1.5 ci-py-1 ci-rounded-full ci-text-xs ci-bg-gray-700 ci-text-gray-50 dark:ci-bg-gray-300 dark:ci-text-gray-900 ci-border-0`,children:[n[e]?.name??e,L.close]},e))}),(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700`}),(0,I.jsxs)(`ul`,{className:`ci-overflow-y-auto ci-py-1 ci-m-0 ci-p-0 ci-list-none ci-flex-1`,children:[v.length===0&&(0,I.jsx)(`li`,{className:`ci-px-4 ci-py-6 ci-text-center ci-text-sm ci-text-gray-500 dark:ci-text-gray-400`,children:`No operators found`}),v.map(e=>{let t=c.includes(e.username);return(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>y(e.username),className:`ci-w-full ci-flex ci-items-center ci-gap-3 ci-px-4 ci-py-2 ci-bg-transparent ci-border-0 ci-text-left hover:ci-bg-gray-300/70 dark:hover:ci-bg-gray-700/30 ci-text-inherit`,children:[(0,I.jsxs)(`span`,{className:`ci-relative`,children:[(0,I.jsx)(ar,{contact:e,username:e.username,size:36}),(0,I.jsx)(or,{online:r[e.username],presence:e.presence,mobile:i[e.username]})]}),(0,I.jsxs)(`span`,{className:`ci-flex ci-flex-col ci-min-w-0 ci-flex-1`,children:[(0,I.jsx)(`span`,{className:`ci-text-sm ci-font-medium ci-truncate`,children:e.name}),(0,I.jsx)(`span`,{className:`ci-text-xs ci-text-gray-500 dark:ci-text-gray-400 ci-truncate`,children:e.username})]}),(0,I.jsx)(`span`,{className:`ci-w-5 ci-h-5 ci-rounded-full ci-border ci-flex ci-items-center ci-justify-center ${t?`ci-bg-phoneIslandCall dark:ci-bg-phoneIslandCallDark ci-border-transparent ci-text-white dark:ci-text-gray-950`:`ci-border-gray-400 dark:ci-border-gray-600`}`,children:t&&(0,I.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,I.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})})]})},e.username)})]}),c.length>0&&(0,I.jsx)(`div`,{className:`ci-border-t ci-border-gray-300 dark:ci-border-gray-700 ci-px-4 ci-py-3 ci-flex ci-items-center ci-gap-2`,children:c.length===1?(0,I.jsx)(ur,{variant:`default`,className:`ci-w-auto ci-h-10 ci-px-5`,onClick:()=>e(c[0]),children:`Open chat`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`input`,{ref:_,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>e.target.files?.[0]&&$r(e.target.files[0]).then(h).catch(()=>{})}),(0,I.jsx)(`button`,{type:`button`,title:`Group picture`,onClick:()=>_.current?.click(),className:`ci-w-10 ci-h-10 ci-shrink-0 ci-rounded-full ci-border-0 ci-p-0 ci-overflow-hidden ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-gray-500 dark:ci-text-gray-400 ci-flex ci-items-center ci-justify-center`,children:m?(0,I.jsx)(`img`,{src:m,alt:``,draggable:!1,className:`ci-w-full ci-h-full ci-object-cover`}):L.camera}),(0,I.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Group name`,onKeyDown:e=>e.key===`Enter`&&u.trim()&&!f&&b(),className:`ci-flex-1 ci-min-w-0 ci-w-0 ci-px-4 ci-py-2 ci-rounded-3xl ci-border-0 ci-bg-elevationL2 dark:ci-bg-elevationL2Dark ci-text-sm ci-text-gray-900 dark:ci-text-white placeholder:ci-text-gray-500 dark:placeholder:ci-text-gray-400 ci-outline-none focus:ci-ring-2 focus:ci-ring-gray-400 dark:focus:ci-ring-gray-500`}),(0,I.jsx)(ur,{variant:`green`,className:`ci-w-auto ci-h-10 ci-px-4 ci-shrink-0 ci-whitespace-nowrap`,disabled:!u.trim()||f,onClick:b,children:f?`…`:`Create group`})]})})]})}var ti=`chat-island-theme`,ni=()=>{try{let e=localStorage.getItem(ti);return e===`light`||e===`dark`||e===`system`?e:void 0}catch{return}};function ri(e){let[t,n]=(0,g.useState)(()=>e??ni()),[r,i]=(0,g.useState)(!1);return(0,g.useEffect)(()=>n(e??ni()),[e]),(0,g.useEffect)(()=>{let e=e=>{let t=e.detail?.theme;if(t===`light`||t===`dark`||t===`system`){try{localStorage.setItem(ti,t)}catch{}n(t)}};return window.addEventListener(`chat-island-theme-change`,e),()=>window.removeEventListener(`chat-island-theme-change`,e)},[]),(0,g.useEffect)(()=>{if(t===`light`||t===`dark`){i(t===`dark`);return}if(t===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>i(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}let e=document.documentElement,n=()=>i(e.classList.contains(`dark`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>r.disconnect()},[t]),r}function ii(){let e=P.getState();return Object.values(e.conversations).map(t=>{let n=t.messages[t.messages.length-1],r=e.contacts[t.peer];return{peer:t.peer,kind:t.kind,name:t.kind===`group`?t.name??t.peer.split(`@`)[0]:r?.name??t.peer,avatar:t.kind===`group`?t.avatar:r?.avatar,online:t.kind!==`group`&&!!e.online[t.peer],mobile:t.kind!==`group`&&!!e.mobile[t.peer],owner:t.kind===`group`?!!t.owner:void 0,unread:t.unread,members:t.members,last:n?{body:si(n.body),ts:n.ts,mine:n.mine,oob:n.oob,nick:n.nick}:void 0}}).filter(e=>e.last||e.kind===`group`).sort((e,t)=>(t.last?.ts??0)-(e.last?.ts??0))}var ai=class extends g.Component{state={failed:!1};failures=[];static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){F(`chat-island-error`,{scope:`render`,message:e.message});let t=Date.now();this.failures=[...this.failures.filter(e=>t-e<1e4),t],!(this.failures.length>=3)&&(P.getState().closeChat(),window.setTimeout(()=>this.setState({failed:!1}),0))}render(){return this.state.failed?null:this.props.children}};function oi(e){try{let[t,n,r]=atob(e).split(`:`);return t&&n&&r?{host:t,username:n,token:r}:null}catch{return null}}var si=e=>(Dr(e)?`Attachment`:gr(e)).replace(/```[^\n]*\n?/g,``).replace(/(\*\*|__|~~|`)/g,``).replace(/(^|\s)[*_](\S[^*_]*)[*_]/g,`$1$2`).replace(/\s+/g,` `).trim();function ci({dataConfig:e,position:t=`bottom-right`,theme:n,serviceWorker:r,maxHeads:i=5,newChatButton:a=!0,notifications:o=`click`,sound:s=!0,drag:c=!0,onDragStart:l}){let u=(0,g.useMemo)(()=>oi(e),[e]),d=ri(n),f=(0,g.useRef)(u),p=(0,g.useRef)(s),m=(0,g.useRef)(o);(0,g.useEffect)(()=>{f.current=u,p.current=s,m.current=o},[u,s,o]),(0,g.useEffect)(()=>P.setState({maxHeads:i,newChatButton:a}),[i,a]);let[h,_]=(0,g.useState)(0);(0,g.useEffect)(()=>{let e=e=>e.persisted&&_(e=>e+1);return window.addEventListener(`pageshow`,e),()=>window.removeEventListener(`pageshow`,e)},[]);let v=(0,g.useRef)(null),b=(0,g.useRef)(new Set),S=(0,g.useRef)(!1),C=(0,g.useRef)(null),w=(0,g.useRef)(null),T=x(w,`chat-island-pos:${u?.host??``}:${u?.username??``}`),{open:ee,picker:te,status:ne}=P(y(e=>({open:e.open,picker:e.picker,status:e.status}))),re=(0,g.useMemo)(()=>({send:async(e,t,n)=>{let r=v.current;if(!r)throw Error(`not connected`);try{P.getState().addMessage(e,await r.send(e,gr(t),void 0,n))}catch(e){throw F(`chat-island-error`,{scope:`send`,message:e.message}),e}},typing:(e,t)=>P.getState().online[e]&&v.current?.typing(e,t).catch(()=>{}),upload:async(e,t)=>{let n=v.current;if(n)try{let r=await n.upload(t);P.getState().addMessage(e,await n.send(e,t.name,r))}catch(e){F(`chat-island-error`,{scope:`upload`,message:e.message})}},createGroup:async(e,t,n)=>{let r=v.current,i=f.current;if(r&&i)try{let a=await r.createGroup(e,t,n),o=P.getState();o.setGroup(a,e,[...t,i.username],n),o.openChat(a)}catch(e){F(`chat-island-error`,{scope:`group`,message:e.message})}},remove:async e=>{let t=v.current,n=f.current;if(!t||!n)return;let r=P.getState().conversations[e];try{r?.kind===`group`&&await t.leaveGroup(e,!!r.owner).catch(()=>{}),await Zn(n.host,n.token,e),P.getState().removeConversation(e)}catch(e){F(`chat-island-error`,{scope:`delete`,message:e.message})}},react:async(e,t,n)=>{let r=v.current,i=f.current?.username;if(!r||!i)return;let a=(P.getState().conversations[e]?.reactions?.[t]?.[i]??[]).includes(n)?[]:[n];try{await r.react(e,t,a),P.getState().applyReactions([{peer:e,target:t,user:i,emojis:a}])}catch(e){F(`chat-island-error`,{scope:`reaction`,message:e.message})}},loadOlder:async e=>{let t=v.current,n=P.getState().ensure(e);if(!(!t||n.complete||b.current.has(e))){b.current.add(e);try{let r=await t.history(e,n.oldest);P.getState().prependHistory(e,r.messages,r.complete,r.first),P.getState().applyReactions(r.reactions)}catch(e){F(`chat-island-error`,{scope:`history`,message:e.message})}finally{b.current.delete(e)}}}}),[]);(0,g.useEffect)(()=>{if(!u)return;let e=P.getState();e.reset(),P.setState({me:u.username,mucHost:`conference.${u.host}`,maxHeads:i,newChatButton:a});let t=new Cn(u,{status:(n,i)=>{if(e.setStatus(n,i),F(`chat-island-status`,{status:n,error:i}),n===`online`&&r&&!S.current&&typeof Notification<`u`){let e=Notification.permission;(e===`granted`||m.current===`auto`&&e==="default")&&o()}n===`online`&&t.listGroups().then(t=>t.forEach(t=>e.setGroup(t.peer,t.name,t.members,t.avatar,t.owner))).catch(()=>{}).then(()=>t.recent()).then(e=>{e&&(P.getState().seed(e.messages,u.username),P.getState().applyReactions(e.reactions))}).catch(()=>{})},typing:(t,n)=>e.setTyping(t,n),reaction:t=>e.applyReactions([t]),presence:(t,n)=>e.setOnline(t,n),groupDestroyed:t=>e.removeConversation(t),groupInvite:n=>{t.subscribed(n).then(async r=>{if(!r)return;let i=await t.groupInfo(n);e.setGroup(i.peer,i.name,i.members,i.avatar,i.owner)}).catch(()=>{})},message:r=>{let i=Wn(r);r.room&&!P.getState().conversations[r.room]?.name&&t.groupInfo(r.room).then(t=>e.setGroup(t.peer,t.name,t.members,t.avatar,t.owner)).catch(()=>{}),e.addMessage(i,r,{live:!0}),F(`chat-island-message`,{...r,peer:i}),F(`chat-island-unread`,{total:P.getState().totalUnread()}),r.mine||n(i,r)}}),n=(e,t)=>{let n=P.getState(),r=document.visibilityState===`visible`;if(r&&n.open===e)return;let i=n.conversations[e],a=i?.kind===`group`?i.name??e:n.contacts[e]?.name??e,o=t.oob?`Attachment`:gr(t.body),s=i?.kind===`group`,c=s&&t.nick?n.contacts[t.nick]?.name??t.nick:a,l=s&&t.nick?`${c}: ${o}`:o;p.current&&jn();let u=s?i?.avatar:n.contacts[e]?.avatar;if(F(`chat-island-notify`,{peer:e,name:a,body:l,kind:s?`group`:`chat`,author:c,text:o,attachment:!!t.oob,avatar:u,ts:t.ts}),!r&&typeof Notification<`u`&&Notification.permission===`granted`)try{let t=new Notification(a,{body:l,tag:`chat-${e}`});t.onclick=()=>{window.focus(),P.getState().openChat(e),t.close()}}catch{}};v.current=t;let o=()=>{r&&!S.current&&(S.current=!0,tr(u,r).then(e=>{if(!e){S.current=!1,P.setState({push:Notification.permission===`denied`?`denied`:`ask`});return}return t.enablePush(e.service,e.node).then(()=>{C.current=e,P.setState({push:`enabled`}),F(`chat-island-push`,{enabled:!0})})}).catch(e=>{S.current=!1,F(`chat-island-error`,{scope:`push`,message:e.message})}))},s=!!r&&`serviceWorker`in navigator&&`PushManager`in window&&typeof Notification<`u`;P.setState({push:s?Notification.permission===`denied`?`denied`:`ask`:`unavailable`,enablePush:o});let c=()=>t.stop();window.addEventListener(`pagehide`,c),t.start();let l=()=>Xn(u.host,u.token).then(e.setMobile).catch(()=>{});l();let d=window.setInterval(l,12e4);Yn(u.host,u.token,u.username,e=>P.setState({myName:e})).then(e.setContacts).catch(e=>F(`chat-island-error`,{scope:`contacts`,message:e.message}));let f=nr(`chat-island-open`,({username:t})=>t&&e.openChat(t)),h=nr(`chat-island-close`,()=>e.closeChat()),g=nr(`chat-island-new`,()=>e.setPicker(!0)),_=nr(`chat-island-delete`,({username:e})=>e&&re.remove(e)),y=nr(`chat-island-contacts`,({contacts:t})=>t&&e.setContacts(t)),b=nr(`chat-island-conversations-request`,()=>F(`chat-island-conversations`,{conversations:ii()}));return()=>{window.removeEventListener(`pagehide`,c),window.clearInterval(d),b(),g(),_(),f(),h(),y(),C.current&&t.disablePush(C.current.service,C.current.node).catch(()=>{}),C.current=null,t.stop(),v.current=null,S.current=!1}},[u,r,h]);let ie=P(e=>Object.keys(e.contacts).join(`,`));(0,g.useEffect)(()=>{ne===`online`&&ie&&v.current?.announce(ie.split(`,`))},[ne,ie]);let ae=P(e=>Object.values(e.conversations).map(e=>`${e.peer}:${e.kind}:${e.name??``}:${(e.members??[]).length}:${e.unread}:${e.messages[e.messages.length-1]?.id??``}`).join(`|`)+`#`+Object.keys(e.contacts).length+`#`+Object.values(e.online).filter(Boolean).length);(0,g.useEffect)(()=>F(`chat-island-conversations`,{conversations:ii()}),[ae]);let oe=P(e=>Object.values(e.conversations).reduce((e,t)=>e+t.unread,0));if((0,g.useEffect)(()=>F(`chat-island-unread`,{total:oe}),[oe]),!u)return null;let se=c&&!l&&T.anchor?{right:T.anchor.right,bottom:T.anchor.bottom}:void 0,E=se?``:t===`bottom-left`?`ci-left-4 ci-bottom-5`:`ci-right-4 ci-bottom-5`;return(0,I.jsx)(`div`,{ref:w,style:se,onClickCapture:T.onClickCapture,className:`chat-island-root ${d?`ci-dark`:``} ci-fixed ${E} ci-z-[9999] ci-flex ci-items-end ci-gap-3 ci-font-sans ci-select-none`,"data-status":ne,children:(0,I.jsxs)(ai,{children:[ee&&(0,I.jsx)(Qr,{peer:ee,actions:re,onDragStart:l??(c?T.start:void 0)}),te&&(0,I.jsx)(ei,{onOpen:e=>P.getState().openChat(e),onCreateGroup:re.createGroup}),(0,I.jsx)(dr,{onDragStart:l??(c?T.start:void 0),pushButton:o!==`auto`})]})})}document.querySelectorAll(`.chat-island`).forEach(e=>{let t=e.dataset;(0,h.createRoot)(e).render((0,I.jsx)(g.StrictMode,{children:(0,I.jsx)(ci,{dataConfig:t.config??``,position:t.position===`bottom-left`?`bottom-left`:`bottom-right`,theme:t.theme,serviceWorker:t.serviceWorker,newChatButton:t.newChatButton!==`false`,notifications:t.notifications===`auto`?`auto`:`click`})}))})})();
|