moi-computer 0.5.2-next.1 → 0.6.1-next.0
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 +39 -0
- package/client/AGENTS.md +9 -0
- package/client/api/app-ui-keys.ts +4 -0
- package/client/api/workspace-keys.ts +2 -2
- package/client/app/routes/WorkspaceRoute.tsx +8 -28
- package/client/components/shared/Composer.tsx +3 -6
- package/client/components/shared/IconGhost.tsx +130 -0
- package/client/components/ui/dropdown-menu.tsx +1 -1
- package/client/components/ui/spinner.tsx +18 -0
- package/client/components/ui/toast.tsx +220 -0
- package/client/features/chat/ChatComposer.tsx +3 -2
- package/client/features/chat/ChatPanel.tsx +7 -6
- package/client/features/chat/ChatPopup.tsx +10 -4
- package/client/features/chat/ChatSelector.tsx +263 -48
- package/client/features/chat/ModelPicker.tsx +13 -18
- package/client/features/chat/api.ts +36 -9
- package/client/features/chat/chat-frames.ts +35 -6
- package/client/features/chat/chat-send.ts +25 -1
- package/client/features/chat/chat-store.ts +43 -18
- package/client/features/chat/useChat.ts +54 -52
- package/client/features/chat/useSelectedSession.ts +151 -0
- package/client/features/chat/useStickToBottom.ts +3 -3
- package/client/features/home/api.ts +0 -2
- package/client/features/scratchpad/ScratchpadControls.tsx +2 -2
- package/client/features/settings/WorkspaceSettings.tsx +6 -6
- package/client/features/views/ViewBuilderTab.tsx +3 -4
- package/client/features/views/useViewBuilderActions.ts +3 -1
- package/client/features/workspace/WorkspaceScreen.tsx +38 -17
- package/client/features/workspace/WorkspaceTabs.tsx +10 -1
- package/client/main.tsx +2 -0
- package/client/runtime/useWorkspaceEvents.ts +1 -0
- package/client/store/ui.ts +2 -2
- package/dist/{chunk-zs4mte79.js → chunk-0pcdwjkp.js} +1 -1
- package/dist/chunk-175bm057.js +27 -0
- package/dist/chunk-55sh4dty.js +2 -0
- package/dist/{chunk-tzz101ea.js → chunk-9y2zbzqz.js} +1 -1
- package/dist/{chunk-jvhvme3z.js → chunk-afgbg75t.js} +1 -1
- package/dist/chunk-agtetn7n.css +1 -0
- package/dist/chunk-dfs36zgc.js +1 -0
- package/dist/chunk-exj6hr30.js +9 -0
- package/dist/{chunk-bcrkdhwe.js → chunk-m11ckkxd.js} +1 -1
- package/dist/{chunk-kfw1qwqe.js → chunk-rxvx4ta9.js} +3 -3
- package/dist/{chunk-xwhya7kb.js → chunk-w3tnv51j.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/attachment-note.ts +18 -0
- package/lib/chat-title.ts +6 -0
- package/lib/types.ts +24 -10
- package/package.json +1 -1
- package/server/agent-caller.ts +16 -0
- package/server/api.ts +90 -9
- package/server/app-settings.ts +1 -1
- package/server/cli.ts +628 -45
- package/server/control.ts +18 -1
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +6 -0
- package/server/harness/claude-code/adapter.ts +2 -2
- package/server/harness/claude-code/index.ts +7 -1
- package/server/harness/claude-code/session-title.ts +106 -0
- package/server/harness/claude-code/session.ts +107 -17
- package/server/harness/claude-code/sessions.ts +63 -4
- package/server/harness/codex/client.ts +33 -13
- package/server/harness/codex/index.ts +2 -0
- package/server/harness/codex/session-title.ts +149 -0
- package/server/harness/codex/session.ts +84 -11
- package/server/harness/openclaw/adapter.ts +4 -2
- package/server/harness/openclaw/discovery.ts +2 -0
- package/server/harness/openclaw/session.ts +15 -7
- package/server/harness/session-title.ts +96 -0
- package/server/harness/types.ts +2 -0
- package/server/selected-session.ts +132 -0
- package/server/service.ts +786 -0
- package/server/{thread-config.ts → session-config.ts} +57 -39
- package/server/status.ts +2 -0
- package/server/update.ts +141 -0
- package/server/version.ts +41 -0
- package/server/web.ts +17 -1
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +16 -26
- package/workspace/.claude/skills/moi-workspace/SKILL.md +8 -2
- package/dist/chunk-94m3q9ce.js +0 -1
- package/dist/chunk-k9dcnd73.js +0 -27
- package/dist/chunk-pk11vfzs.js +0 -9
- package/dist/chunk-r2bqaege.js +0 -2
- package/dist/chunk-y4g8j7mv.css +0 -1
|
@@ -5,12 +5,13 @@ import { AnimatePresence, motion } from 'motion/react'
|
|
|
5
5
|
import {
|
|
6
6
|
IconArticle,
|
|
7
7
|
IconBrowserPlus,
|
|
8
|
-
IconGhost,
|
|
9
8
|
IconLayout2,
|
|
10
9
|
IconLayoutSidebarRight,
|
|
11
10
|
IconLetterCase,
|
|
12
11
|
IconSketching
|
|
13
12
|
} from '@tabler/icons-react'
|
|
13
|
+
|
|
14
|
+
import { IconGhost } from '@/client/components/shared/IconGhost'
|
|
14
15
|
import { ChatPanel } from '@/client/features/chat/ChatPanel'
|
|
15
16
|
import { ChatPopup } from '@/client/features/chat/ChatPopup'
|
|
16
17
|
import { CustomizePanel } from '@/client/features/workspace/CustomizePanel'
|
|
@@ -33,6 +34,11 @@ import { useWorkspaceAvailability } from '@/client/features/workspace/api'
|
|
|
33
34
|
import { WorkspaceSkillUpdateBanner } from '@/client/features/workspace/WorkspaceSkillUpdateBanner'
|
|
34
35
|
import { useWorkspaceSkillUpdates } from '@/client/features/workspace/useWorkspaceSkillUpdates'
|
|
35
36
|
import { useWorkspaceTheme } from '@/client/runtime/workspace-theme'
|
|
37
|
+
import {
|
|
38
|
+
hasRunningWorkspaceActivity,
|
|
39
|
+
isSessionRunning,
|
|
40
|
+
useLive
|
|
41
|
+
} from '@/client/features/chat/chat-store'
|
|
36
42
|
import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
|
|
37
43
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
|
|
38
44
|
import {
|
|
@@ -43,7 +49,6 @@ import {
|
|
|
43
49
|
import { useWorkspaceNavigation } from '@/client/features/workspace/useWorkspaceNavigation'
|
|
44
50
|
import { resolveAppIcon } from '@/client/lib/app-icon-registry'
|
|
45
51
|
import { cn } from '@/client/lib/cn'
|
|
46
|
-
import { liveStore } from '@/client/features/chat/chat-store'
|
|
47
52
|
import { useWorkspaceEvent } from '@/client/runtime/useWorkspaceEvents'
|
|
48
53
|
import { useUiStore } from '@/client/store/ui'
|
|
49
54
|
import {
|
|
@@ -194,14 +199,17 @@ function tabItemFor(
|
|
|
194
199
|
tab: WorkspaceTabId,
|
|
195
200
|
views: ViewInfo[],
|
|
196
201
|
builders: ViewBuilder[],
|
|
197
|
-
closable: boolean
|
|
202
|
+
closable: boolean,
|
|
203
|
+
agentRunning: boolean,
|
|
204
|
+
builderRunning: (sessionId: string) => boolean
|
|
198
205
|
): WorkspaceTabItem | null {
|
|
199
206
|
if (tab === 'agent') {
|
|
200
207
|
return {
|
|
201
208
|
key: tab,
|
|
202
209
|
Icon: IconGhost,
|
|
203
210
|
label: 'Agent',
|
|
204
|
-
closable
|
|
211
|
+
closable,
|
|
212
|
+
loading: agentRunning
|
|
205
213
|
}
|
|
206
214
|
}
|
|
207
215
|
if (tab === 'widgets') {
|
|
@@ -227,7 +235,8 @@ function tabItemFor(
|
|
|
227
235
|
key: tab,
|
|
228
236
|
Icon: viewBuilderIcon(builder),
|
|
229
237
|
label: builder.title || builder.viewId || 'New view',
|
|
230
|
-
closable
|
|
238
|
+
closable,
|
|
239
|
+
loading: builderRunning(builder.sessionId)
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
242
|
const viewId = viewIdFromTab(tab)
|
|
@@ -265,6 +274,8 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
265
274
|
const [widgetMode, setWidgetMode] = useState<WidgetMode>('idle')
|
|
266
275
|
const [floatingChatOpen, setFloatingChatOpen] = useState(false)
|
|
267
276
|
const [chatFocusRequest, setChatFocusRequest] = useState(0)
|
|
277
|
+
const sessionActivity = useLive(state => state.activity)
|
|
278
|
+
const hasRunningSession = hasRunningWorkspaceActivity(sessionActivity, workspaceId)
|
|
268
279
|
|
|
269
280
|
useWorkspaceTheme(layout.theme)
|
|
270
281
|
|
|
@@ -301,7 +312,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
301
312
|
error,
|
|
302
313
|
send,
|
|
303
314
|
stop,
|
|
304
|
-
|
|
315
|
+
selectSession,
|
|
305
316
|
dismissError
|
|
306
317
|
} = useChat({ activeTab, appletParams })
|
|
307
318
|
|
|
@@ -318,7 +329,14 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
318
329
|
const canCloseTabs = openTabIds.length > 1
|
|
319
330
|
const tabItems = visibleTabIds
|
|
320
331
|
.map(tab =>
|
|
321
|
-
tabItemFor(
|
|
332
|
+
tabItemFor(
|
|
333
|
+
tab,
|
|
334
|
+
views,
|
|
335
|
+
builders,
|
|
336
|
+
canCloseTabs || viewBuilderIdFromTab(tab) !== null,
|
|
337
|
+
hasRunningSession,
|
|
338
|
+
sessionId => isSessionRunning(sessionActivity, workspaceId, sessionId)
|
|
339
|
+
)
|
|
322
340
|
)
|
|
323
341
|
.filter((tab): tab is WorkspaceTabItem => Boolean(tab))
|
|
324
342
|
const activeViewId = viewIdFromTab(activeTab)
|
|
@@ -375,11 +393,6 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
375
393
|
setLayout({ tabs: { open: open.length > 0 ? open : ['agent'], active } })
|
|
376
394
|
}, [activeTab, builders, navigateToTab, setLayout, tabsState, views])
|
|
377
395
|
|
|
378
|
-
useEffect(() => {
|
|
379
|
-
const linked = activeBuilder ?? builders.find(builder => builder.viewId === activeViewId)
|
|
380
|
-
if (linked) liveStore.getState().setActive(workspaceId, linked.sessionId)
|
|
381
|
-
}, [activeBuilder, activeViewId, builders, workspaceId])
|
|
382
|
-
|
|
383
396
|
useEffect(() => {
|
|
384
397
|
if (mode !== 'fullscreen' || activeTab === 'agent') {
|
|
385
398
|
setFloatingChatOpen(false)
|
|
@@ -527,6 +540,10 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
527
540
|
Icon: IconBrowserPlus,
|
|
528
541
|
label: 'New view',
|
|
529
542
|
onClick: () => {
|
|
543
|
+
// Do NOT select the draft's pre-minted sessionId here: no session
|
|
544
|
+
// exists behind it until submit, so making it the chat selection turns
|
|
545
|
+
// the chat into a dead "New chat" whose sends try to resume a session
|
|
546
|
+
// that isn't there. Submit selects it once the chat actually starts.
|
|
530
547
|
void builderActions.create().then(builder => openTab(viewBuilderTabId(builder.id)))
|
|
531
548
|
}
|
|
532
549
|
}
|
|
@@ -550,7 +567,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
550
567
|
unavailableReason={unavailableReason}
|
|
551
568
|
send={send}
|
|
552
569
|
stop={stop}
|
|
553
|
-
|
|
570
|
+
onSelectSession={selectSession}
|
|
554
571
|
/>
|
|
555
572
|
)
|
|
556
573
|
|
|
@@ -571,7 +588,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
571
588
|
unavailableReason={unavailableReason}
|
|
572
589
|
send={send}
|
|
573
590
|
stop={stop}
|
|
574
|
-
|
|
591
|
+
onSelectSession={selectSession}
|
|
575
592
|
/>
|
|
576
593
|
)
|
|
577
594
|
|
|
@@ -628,7 +645,10 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
628
645
|
editing={widgetMode === 'editing'}
|
|
629
646
|
onEditingChange={editing => setWidgetMode(editing ? 'editing' : 'idle')}
|
|
630
647
|
widgets={widgets}
|
|
631
|
-
onCreateWidget={() =>
|
|
648
|
+
onCreateWidget={() => {
|
|
649
|
+
selectSession(null)
|
|
650
|
+
openChat('Create widget')
|
|
651
|
+
}}
|
|
632
652
|
/>
|
|
633
653
|
) : activeTab === 'scratchpad' ? (
|
|
634
654
|
<Suspense fallback={null}>
|
|
@@ -645,7 +665,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
645
665
|
return builderActions.submit(activeBuilder, requirements)
|
|
646
666
|
}}
|
|
647
667
|
onOpenChat={() => {
|
|
648
|
-
|
|
668
|
+
selectSession(activeBuilder.sessionId)
|
|
649
669
|
openChat()
|
|
650
670
|
}}
|
|
651
671
|
onDiscard={() => discardBuilder(activeBuilder)}
|
|
@@ -675,6 +695,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
675
695
|
|
|
676
696
|
{mode === 'fullscreen' && activeTab !== 'agent' && hasWorkspaceContent && (
|
|
677
697
|
<ChatPopup
|
|
698
|
+
loading={hasRunningSession}
|
|
678
699
|
open={floatingChatOpen}
|
|
679
700
|
onOpenChange={setFloatingChatOpen}
|
|
680
701
|
onOpenChangeComplete={open => {
|
|
@@ -702,7 +723,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
702
723
|
unavailableReason={unavailableReason}
|
|
703
724
|
send={send}
|
|
704
725
|
stop={stop}
|
|
705
|
-
|
|
726
|
+
onSelectSession={selectSession}
|
|
706
727
|
onClose={onClose}
|
|
707
728
|
/>
|
|
708
729
|
)}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IconPlus, IconX, type TablerIcon } from '@tabler/icons-react'
|
|
2
2
|
import { cva } from 'class-variance-authority'
|
|
3
3
|
|
|
4
|
+
import { IconGhost } from '@/client/components/shared/IconGhost'
|
|
4
5
|
import { ReorderableList } from '@/client/components/shared/ReorderableList'
|
|
5
6
|
import type { ReorderableRenderState } from '@/client/components/shared/ReorderableList'
|
|
6
7
|
import { Button, buttonVariants } from '@/client/components/ui/button'
|
|
8
|
+
import { Spinner } from '@/client/components/ui/spinner'
|
|
7
9
|
import {
|
|
8
10
|
DropdownMenu,
|
|
9
11
|
DropdownMenuContent,
|
|
@@ -19,6 +21,7 @@ export type WorkspaceTabItem = {
|
|
|
19
21
|
Icon: TablerIcon
|
|
20
22
|
label: string
|
|
21
23
|
closable?: boolean
|
|
24
|
+
loading?: boolean
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
export type CreateWorkspaceTabItem = {
|
|
@@ -131,7 +134,13 @@ function WorkspaceTab(props: WorkspaceTabProps) {
|
|
|
131
134
|
tab.closable && 'group-hover/tab:mr-3'
|
|
132
135
|
)}
|
|
133
136
|
>
|
|
134
|
-
|
|
137
|
+
{tab.Icon === IconGhost ? (
|
|
138
|
+
<IconGhost data-icon="inline-start" stroke={2} animated={tab.loading} />
|
|
139
|
+
) : tab.loading ? (
|
|
140
|
+
<Spinner data-icon="inline-start" />
|
|
141
|
+
) : (
|
|
142
|
+
<tab.Icon data-icon="inline-start" stroke={2} />
|
|
143
|
+
)}
|
|
135
144
|
<span
|
|
136
145
|
className={cn(
|
|
137
146
|
'truncate',
|
package/client/main.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Agentation } from 'agentation'
|
|
|
3
3
|
import { createRoot } from 'react-dom/client'
|
|
4
4
|
import { Router, useRoute } from 'wouter'
|
|
5
5
|
|
|
6
|
+
import { Toaster } from '@/client/components/ui/toast'
|
|
6
7
|
import { TooltipProvider } from '@/client/components/ui/tooltip'
|
|
7
8
|
import { installAppletErrorHook } from '@/client/features/applets/applet-log'
|
|
8
9
|
import { initConnection } from '@/client/features/chat/chat-connection'
|
|
@@ -35,6 +36,7 @@ export function mount(el: HTMLElement) {
|
|
|
35
36
|
<Router>
|
|
36
37
|
<AppRouter />
|
|
37
38
|
</Router>
|
|
39
|
+
<Toaster />
|
|
38
40
|
{process.env.NODE_ENV === 'development' && <DevAgentation />}
|
|
39
41
|
</TooltipProvider>
|
|
40
42
|
</QueryClientProvider>
|
|
@@ -13,6 +13,7 @@ export type WorkspaceEvent =
|
|
|
13
13
|
| { type: 'view-layout:updated'; views: ViewInfo[] }
|
|
14
14
|
| { type: 'view-builder:updated'; workspaceId: string; builder: ViewBuilder }
|
|
15
15
|
| { type: 'view-builder:deleted'; workspaceId: string; builderId: string }
|
|
16
|
+
| { type: 'selected-session:updated'; workspaceId: string; sessionId: string | null }
|
|
16
17
|
| { type: 'theme:updated' }
|
|
17
18
|
| { type: 'workspace:updated' }
|
|
18
19
|
// The registry list changed (reorder, create) without touching any open
|
package/client/store/ui.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { create } from 'zustand'
|
|
|
2
2
|
import { createJSONStorage, persist } from 'zustand/middleware'
|
|
3
3
|
import type { StateStorage } from 'zustand/middleware'
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
// so they survive reloads. Server-
|
|
5
|
+
// Per-browser UI preferences and onboarding markers, persisted to localStorage
|
|
6
|
+
// so they survive reloads. Server-backed per-user app state belongs in DATA_DIR.
|
|
7
7
|
type UiStore = {
|
|
8
8
|
discoveredWorkspacesOpen: boolean
|
|
9
9
|
hasSentMessageFromMoi: boolean
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-9y2zbzqz.js";function t(z,Q){return z[13]=1,z[14]=Q>>8,z[15]=Q&255,z[16]=Q>>8,z[17]=Q&255,z}var e=112,zz=72,Qz=89,Zz=115,p;function Nz(){let z=new Int32Array(256);for(let Q=0;Q<256;Q++){let Z=Q;for(let $=0;$<8;$++)Z=Z&1?3988292384^Z>>>1:Z>>>1;z[Q]=Z}return z}function Iz(z){let Q=-1;if(!p)p=Nz();for(let Z=0;Z<z.length;Z++)Q=p[(Q^z[Z])&255]^Q>>>8;return Q^-1}function Uz(z){let Q=z.length-1;for(let Z=Q;Z>=4;Z--)if(z[Z-4]===9&&z[Z-3]===e&&z[Z-2]===zz&&z[Z-1]===Qz&&z[Z]===Zz)return Z-3;return 0}function $z(z,Q,Z=!1){let $=new Uint8Array(13);Q*=39.3701,$[0]=e,$[1]=zz,$[2]=Qz,$[3]=Zz,$[4]=Q>>>24,$[5]=Q>>>16,$[6]=Q>>>8,$[7]=Q&255,$[8]=$[4],$[9]=$[5],$[10]=$[6],$[11]=$[7],$[12]=1;let Y=Iz($),K=new Uint8Array(4);if(K[0]=Y>>>24,K[1]=Y>>>16,K[2]=Y>>>8,K[3]=Y&255,Z){let X=Uz(z);return z.set($,X),z.set(K,X+13),z}else{let X=new Uint8Array(4);X[0]=0,X[1]=0,X[2]=0,X[3]=9;let J=new Uint8Array(54);return J.set(z,0),J.set(X,33),J.set($,37),J.set(K,50),J}}var Dz="AAlwSFlz",Fz="AAAJcEhZ",Rz="AAAACXBI";function wz(z){let Q=z.indexOf(Dz);if(Q===-1)Q=z.indexOf(Fz);if(Q===-1)Q=z.indexOf(Rz);return Q}var Jz="[modern-screenshot]",D=typeof window<"u",Ez=D&&"Worker"in window,Kz=D&&"atob"in window,Cz=D&&"btoa"in window,x=D?window.navigator?.userAgent:"",Yz=x.includes("Chrome"),S=x.includes("AppleWebKit")&&!Yz,u=x.includes("Firefox"),fz=(z)=>z&&("__CONTEXT__"in z),Tz=(z)=>z.constructor.name==="CSSFontFaceRule",bz=(z)=>z.constructor.name==="CSSImportRule",Sz=(z)=>z.constructor.name==="CSSLayerBlockRule",k=(z)=>z.nodeType===1,f=(z)=>typeof z.className==="object",Xz=(z)=>z.tagName==="image",hz=(z)=>z.tagName==="use",w=(z)=>k(z)&&typeof z.style<"u"&&!f(z),gz=(z)=>z.nodeType===8,vz=(z)=>z.nodeType===3,R=(z)=>z.tagName==="IMG",h=(z)=>z.tagName==="VIDEO",pz=(z)=>z.tagName==="CANVAS",yz=(z)=>z.tagName==="TEXTAREA",mz=(z)=>z.tagName==="INPUT",xz=(z)=>z.tagName==="STYLE",uz=(z)=>z.tagName==="SCRIPT",iz=(z)=>z.tagName==="SELECT",cz=(z)=>z.tagName==="SLOT",dz=(z)=>z.tagName==="IFRAME",az=(...z)=>console.warn(Jz,...z);function lz(z){let Q=z?.createElement?.("canvas");if(Q)Q.height=Q.width=1;return Boolean(Q)&&"toDataURL"in Q&&Boolean(Q.toDataURL("image/webp").includes("image/webp"))}var y=(z)=>z.startsWith("data:");function Gz(z,Q){if(z.match(/^[a-z]+:\/\//i))return z;if(D&&z.match(/^\/\//))return window.location.protocol+z;if(z.match(/^[a-z]+:/i))return z;if(!D)return z;let Z=g().implementation.createHTMLDocument(),$=Z.createElement("base"),Y=Z.createElement("a");if(Z.head.appendChild($),Z.body.appendChild(Y),Q)$.href=Q;return Y.href=z,Y.href}function g(z){return(z&&k(z)?z?.ownerDocument:z)??window.document}var v="http://www.w3.org/2000/svg";function jz(z,Q,Z){let $=g(Z).createElementNS(v,"svg");return $.setAttributeNS(null,"width",z.toString()),$.setAttributeNS(null,"height",Q.toString()),$.setAttributeNS(null,"viewBox",`0 0 ${z} ${Q}`),$}function Vz(z,Q){let Z=new XMLSerializer().serializeToString(z);if(Q)Z=Z.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"");return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z)}`}async function sz(z,Q="image/png",Z=1){try{return await new Promise(($,Y)=>{z.toBlob((K)=>{if(K)$(K);else Y(Error("Blob is null"))},Q,Z)})}catch($){if(Kz)return rz(z.toDataURL(Q,Z));throw $}}function rz(z){let[Q,Z]=z.split(","),$=Q.match(/data:(.+);/)?.[1]??void 0,Y=window.atob(Z),K=Y.length,X=new Uint8Array(K);for(let J=0;J<K;J+=1)X[J]=Y.charCodeAt(J);return new Blob([X],{type:$})}function Hz(z,Q){return new Promise((Z,$)=>{let Y=new FileReader;if(Y.onload=()=>Z(Y.result),Y.onerror=()=>$(Y.error),Y.onabort=()=>$(Error(`Failed read blob to ${Q}`)),Q==="dataUrl")Y.readAsDataURL(z);else if(Q==="arrayBuffer")Y.readAsArrayBuffer(z)})}var nz=(z)=>Hz(z,"dataUrl"),oz=(z)=>Hz(z,"arrayBuffer");function F(z,Q){let Z=g(Q).createElement("img");return Z.decoding="sync",Z.loading="eager",Z.src=z,Z}function E(z,Q){return new Promise((Z)=>{let{timeout:$,ownerDocument:Y,onError:K,onWarn:X}=Q??{},J=typeof z==="string"?F(z,g(Y)):z,V=null,j=null;function G(){Z(J),V&&clearTimeout(V),j?.()}if($)V=setTimeout(G,$);if(h(J)){let M=J.currentSrc||J.src;if(!M){if(J.poster)return E(J.poster,Q).then(Z);return G()}if(J.readyState>=2)return G();let B=G,q=(W)=>{X?.("Failed video load",M,W),K?.(W),G()};j=()=>{J.removeEventListener("loadeddata",B),J.removeEventListener("error",q)},J.addEventListener("loadeddata",B,{once:!0}),J.addEventListener("error",q,{once:!0})}else{let M=Xz(J)?J.href.baseVal:J.currentSrc||J.src;if(!M)return G();let B=async()=>{if(R(J)&&"decode"in J)try{await J.decode()}catch(W){X?.("Failed to decode image, trying to render anyway",J.dataset.originalSrc||M,W)}G()},q=(W)=>{X?.("Failed image load",J.dataset.originalSrc||M,W),G()};if(R(J)&&J.complete)return B();j=()=>{J.removeEventListener("load",B),J.removeEventListener("error",q)},J.addEventListener("load",B,{once:!0}),J.addEventListener("error",q,{once:!0})}})}async function tz(z,Q){if(w(z))if(R(z)||h(z))await E(z,Q);else await Promise.all(["img","video"].flatMap((Z)=>{return Array.from(z.querySelectorAll(Z)).map(($)=>E($,Q))}))}var Bz=function(){let Q=0,Z=()=>`0000${(Math.random()*1679616<<0).toString(36)}`.slice(-4);return()=>{return Q+=1,`u${Z()}${Q}`}}();function Mz(z){return z?.split(",").map((Q)=>Q.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var a=0;function ez(z){let Q=`${Jz}[#${a}]`;return a++,{time:(Z)=>z&&console.time(`${Q} ${Z}`),timeEnd:(Z)=>z&&console.timeEnd(`${Q} ${Z}`),warn:(...Z)=>z&&az(...Z)}}function zQ(z){return{cache:z?"no-cache":"force-cache"}}async function N(z,Q){return fz(z)?z:QQ(z,{...Q,autoDestruct:!0})}async function QQ(z,Q){let{scale:Z=1,workerUrl:$,workerNumber:Y=1}=Q||{},K=Boolean(Q?.debug),X=Q?.features??!0,J=z.ownerDocument??(D?window.document:void 0),V=z.ownerDocument?.defaultView??(D?window:void 0),j=new Map,G={width:0,height:0,quality:1,type:"image/png",scale:Z,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:30000,progress:null,debug:K,fetch:{requestInit:zQ(Q?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...Q?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:Y,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...Q,__CONTEXT__:!0,log:ez(K),node:z,ownerDocument:J,ownerWindow:V,dpi:Z===1?null:96*Z,svgStyleElement:qz(J),svgDefsElement:J?.createElementNS(v,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ez&&$&&Y?Y:0})].map(()=>{try{let q=new Worker($);return q.onmessage=async(W)=>{let{url:H,result:L}=W.data;if(L)j.get(H)?.resolve?.(L);else j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q.onmessageerror=(W)=>{let{url:H}=W.data;j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q}catch(q){return G.log.warn("Failed to new Worker",q),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[lz(J)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:j,drawImageCount:0,tasks:[],features:X,isEnable:(q)=>{if(q==="restoreScrollPosition")return typeof X==="boolean"?!1:X[q]??!1;if(typeof X==="boolean")return X;return X[q]??!0},shadowRoots:[]};G.log.time("wait until load"),await tz(z,{timeout:G.timeout,onWarn:G.log.warn}),G.log.timeEnd("wait until load");let{width:M,height:B}=ZQ(z,G);return G.width=M,G.height=B,G}function qz(z){if(!z)return;let Q=z.createElement("style"),Z=Q.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|