moi-computer 0.13.1-next.4 → 0.14.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 +1 -1
- package/bin/moi.mjs +10 -6
- package/dist/{chunk-k32585ne.js → chunk-828s864r.js} +61 -61
- package/dist/chunk-9ffaaaw3.css +1 -0
- package/dist/chunk-gh11h6dc.js +2 -0
- package/dist/chunk-hhgsmxsq.js +1 -0
- package/dist/chunk-ht9zmff2.js +5 -0
- package/dist/{chunk-0t8m1ehd.js → chunk-jqa4c92z.js} +2 -2
- package/dist/{chunk-qtkv7hp8.js → chunk-kkhswjz8.js} +2 -2
- package/dist/{chunk-wjbejzek.js → chunk-nqh3kx2x.js} +1 -1
- package/dist/chunk-rb2vsqvb.js +1 -0
- package/dist/{chunk-c8g5x288.js → chunk-t22yw8s6.js} +1 -1
- package/dist/chunk-yv6n9e3z.js +72 -0
- package/dist/dot-2bdkpg3k.png +0 -0
- package/dist/duet-3ab8xyzd.png +0 -0
- package/dist/grok-bot-yv07qj9f.png +0 -0
- package/dist/index.html +1 -1
- package/dist/instinct-ypmq6t0w.png +0 -0
- package/dist/muse-qr7zwsvf.png +0 -0
- package/package.json +39 -40
- package/runtime/applets/chunk-bzxakh65.js +2 -0
- package/runtime/applets/chunk-qhjskz2m.js +2 -0
- package/runtime/applets/collab.js +1 -0
- package/runtime/applets/moi.js +1 -0
- package/runtime/applets/rpc.js +2 -0
- package/runtime/assets/shadcn.css +629 -0
- package/runtime/assets/tw-animate.css +1 -0
- package/runtime/build-worker-entry.js +2 -0
- package/runtime/chunk-00rk365r.js +83 -0
- package/runtime/chunk-4wj1jzhr.js +3 -0
- package/runtime/chunk-5egvk1rz.js +3 -0
- package/runtime/chunk-7c0zbz74.js +3 -0
- package/runtime/chunk-8fvgvm56.js +2 -0
- package/runtime/chunk-c3qyet60.js +128 -0
- package/runtime/chunk-ewc55jga.js +32623 -0
- package/runtime/chunk-gbkjshyt.js +26 -0
- package/runtime/chunk-ggphq7nk.js +66 -0
- package/runtime/chunk-h2bwhk81.js +3 -0
- package/runtime/chunk-hjzfk1cr.js +3 -0
- package/runtime/chunk-j0nd7kw0.js +52 -0
- package/runtime/chunk-jb63ns1z.js +2 -0
- package/runtime/chunk-k049dtaq.js +3 -0
- package/runtime/chunk-kjp60rqs.js +3 -0
- package/runtime/chunk-q06m17nb.js +3 -0
- package/runtime/chunk-r5s8rm8n.js +3 -0
- package/runtime/chunk-sdyqhxe1.js +10 -0
- package/runtime/chunk-w1fx9tsc.js +3 -0
- package/runtime/chunk-w6ksnv8y.js +2 -0
- package/runtime/chunk-wvarpvem.js +78 -0
- package/runtime/chunk-zm7k0v1c.js +3 -0
- package/runtime/chunk-zwvtkb81.js +139 -0
- package/runtime/cli.js +246 -0
- package/runtime/functions-worker.js +2 -0
- package/runtime/gateway-client.js +2 -0
- package/runtime/third-party-notices.txt +6830 -0
- package/runtime/worker.js +2 -0
- package/runtime/xdg-open +1267 -0
- package/bunfig.toml +0 -7
- package/client/AGENTS.md +0 -40
- package/client/api/app-config.ts +0 -58
- package/client/api/http.ts +0 -44
- package/client/api/query-client.ts +0 -5
- package/client/api/query-options.ts +0 -6
- package/client/api/workspace-keys.ts +0 -18
- package/client/app/app-provider.tsx +0 -39
- package/client/app/app-router.tsx +0 -57
- package/client/app/routes/home-route.tsx +0 -27
- package/client/app/routes/onboarding-route.tsx +0 -11
- package/client/app/routes/settings-route.tsx +0 -10
- package/client/app/routes/workspace-registration.tsx +0 -68
- package/client/app/routes/workspace-route.tsx +0 -127
- package/client/app/shell/sidebar-layout.tsx +0 -247
- package/client/assets/claude.svg +0 -3
- package/client/assets/favicon.png +0 -0
- package/client/assets/floppy-disk.webp +0 -0
- package/client/assets/hermes.png +0 -0
- package/client/assets/mcp/.gitkeep +0 -0
- package/client/assets/mcp/airtable.png +0 -0
- package/client/assets/mcp/apollo.png +0 -0
- package/client/assets/mcp/asana.png +0 -0
- package/client/assets/mcp/atlassian.png +0 -0
- package/client/assets/mcp/box.png +0 -0
- package/client/assets/mcp/chrome.svg +0 -33
- package/client/assets/mcp/clickup.png +0 -0
- package/client/assets/mcp/cloudflare.png +0 -0
- package/client/assets/mcp/context7.png +0 -0
- package/client/assets/mcp/datadog.png +0 -0
- package/client/assets/mcp/discord.png +0 -0
- package/client/assets/mcp/dropbox.png +0 -0
- package/client/assets/mcp/elevenlabs.png +0 -0
- package/client/assets/mcp/exa.png +0 -0
- package/client/assets/mcp/figma.png +0 -0
- package/client/assets/mcp/firecrawl.png +0 -0
- package/client/assets/mcp/github.png +0 -0
- package/client/assets/mcp/gitlab.png +0 -0
- package/client/assets/mcp/gmail.png +0 -0
- package/client/assets/mcp/googlecalendar.png +0 -0
- package/client/assets/mcp/googledrive.png +0 -0
- package/client/assets/mcp/grafana.png +0 -0
- package/client/assets/mcp/granola.png +0 -0
- package/client/assets/mcp/hubspot.png +0 -0
- package/client/assets/mcp/huggingface.png +0 -0
- package/client/assets/mcp/intercom.png +0 -0
- package/client/assets/mcp/linear.png +0 -0
- package/client/assets/mcp/monday.png +0 -0
- package/client/assets/mcp/mongodb.png +0 -0
- package/client/assets/mcp/neon.png +0 -0
- package/client/assets/mcp/notion.png +0 -0
- package/client/assets/mcp/paper.png +0 -0
- package/client/assets/mcp/paypal.png +0 -0
- package/client/assets/mcp/perplexity.png +0 -0
- package/client/assets/mcp/postgresql.png +0 -0
- package/client/assets/mcp/posthog.png +0 -0
- package/client/assets/mcp/puppeteer.png +0 -0
- package/client/assets/mcp/railway.png +0 -0
- package/client/assets/mcp/redis.png +0 -0
- package/client/assets/mcp/salesforce.png +0 -0
- package/client/assets/mcp/sentry.png +0 -0
- package/client/assets/mcp/shopify.png +0 -0
- package/client/assets/mcp/slack.png +0 -0
- package/client/assets/mcp/snowflake.png +0 -0
- package/client/assets/mcp/stripe.png +0 -0
- package/client/assets/mcp/supabase.png +0 -0
- package/client/assets/mcp/telegram.png +0 -0
- package/client/assets/mcp/twilio.png +0 -0
- package/client/assets/mcp/vercel.png +0 -0
- package/client/assets/mcp/zapier.png +0 -0
- package/client/assets/moi-logo.svg +0 -11
- package/client/assets/openai.svg +0 -1
- package/client/assets/openclaw.svg +0 -22
- package/client/assets.d.ts +0 -14
- package/client/components/shared/agent-blobatar.tsx +0 -93
- package/client/components/shared/bottom-panel.tsx +0 -65
- package/client/components/shared/composer.tsx +0 -125
- package/client/components/shared/led-logo.tsx +0 -181
- package/client/components/shared/panel-header.tsx +0 -16
- package/client/components/shared/reorderable-list.tsx +0 -204
- package/client/components/shared/screen-shell.tsx +0 -23
- package/client/components/shared/ultrafast-icon.tsx +0 -61
- package/client/components/shared/workspace-icon.tsx +0 -83
- package/client/components/ui/alert-dialog.tsx +0 -1
- package/client/components/ui/button.tsx +0 -1
- package/client/components/ui/checkbox.tsx +0 -1
- package/client/components/ui/collapsible.tsx +0 -1
- package/client/components/ui/dialog.tsx +0 -1
- package/client/components/ui/dropdown-menu.tsx +0 -1
- package/client/components/ui/hover-card.tsx +0 -1
- package/client/components/ui/inline-input.tsx +0 -84
- package/client/components/ui/input.tsx +0 -1
- package/client/components/ui/popover.tsx +0 -1
- package/client/components/ui/resizable.tsx +0 -1
- package/client/components/ui/skeleton.tsx +0 -1
- package/client/components/ui/slider.tsx +0 -1
- package/client/components/ui/spinner.tsx +0 -1
- package/client/components/ui/switch.tsx +0 -1
- package/client/components/ui/tabs.tsx +0 -1
- package/client/components/ui/textarea.tsx +0 -1
- package/client/components/ui/toast.tsx +0 -220
- package/client/components/ui/tooltip.tsx +0 -1
- package/client/dev/index.html +0 -43
- package/client/dev/index.ts +0 -15
- package/client/externalize-react.ts +0 -41
- package/client/features/account/account-menu.tsx +0 -96
- package/client/features/account/account-provider.tsx +0 -93
- package/client/features/account/account-test-utils.tsx +0 -310
- package/client/features/account/api.ts +0 -67
- package/client/features/account/profile-actions.ts +0 -29
- package/client/features/app-settings/api.ts +0 -33
- package/client/features/app-settings/avatar-upload.tsx +0 -62
- package/client/features/app-settings/general-settings.tsx +0 -39
- package/client/features/app-settings/profile-settings.tsx +0 -105
- package/client/features/app-settings/settings-page.tsx +0 -45
- package/client/features/app-settings/settings-section.tsx +0 -26
- package/client/features/applets/api.ts +0 -38
- package/client/features/applets/applet-cache.ts +0 -95
- package/client/features/applets/applet-container.tsx +0 -33
- package/client/features/applets/applet-log.ts +0 -81
- package/client/features/applets/applet-runtime.ts +0 -325
- package/client/features/applets/applet-styles.ts +0 -81
- package/client/features/applets/applet-thumbnail.ts +0 -294
- package/client/features/applets/use-applet.ts +0 -210
- package/client/features/applets/widget-error-boundary.tsx +0 -62
- package/client/features/applets/widget-shell.tsx +0 -56
- package/client/features/chat/applet-chat-intents.ts +0 -173
- package/client/features/chat/chat-panel.tsx +0 -326
- package/client/features/chat/chat-popup.tsx +0 -175
- package/client/features/chat/chat-send.ts +0 -259
- package/client/features/chat/chat-store.ts +0 -328
- package/client/features/chat/composer/attachments/attachment-chip.tsx +0 -99
- package/client/features/chat/composer/attachments/draft-attachments.ts +0 -185
- package/client/features/chat/composer/attachments/drawing-attachment-chip.tsx +0 -37
- package/client/features/chat/composer/attachments/file-attachment-chip.tsx +0 -22
- package/client/features/chat/composer/attachments/text-attachment-chip.tsx +0 -11
- package/client/features/chat/composer/attachments/types.ts +0 -25
- package/client/features/chat/composer/attachments/uploads.ts +0 -26
- package/client/features/chat/composer/banners/composer-banner.tsx +0 -16
- package/client/features/chat/composer/banners/error-banner.tsx +0 -36
- package/client/features/chat/composer/banners/skill-update-banner.tsx +0 -93
- package/client/features/chat/composer/chat-composer.tsx +0 -290
- package/client/features/chat/composer/model-order.ts +0 -110
- package/client/features/chat/composer/model-picker.tsx +0 -408
- package/client/features/chat/composer/use-workspace-composer-state.tsx +0 -69
- package/client/features/chat/composer/use-workspace-skill-updates.ts +0 -160
- package/client/features/chat/connection/chat-connection.ts +0 -64
- package/client/features/chat/connection/chat-frames.ts +0 -153
- package/client/features/chat/messages/chat-empty-state.tsx +0 -294
- package/client/features/chat/messages/chat-prompt-bubbles.tsx +0 -72
- package/client/features/chat/messages/fork-history.ts +0 -14
- package/client/features/chat/messages/group-turns.ts +0 -74
- package/client/features/chat/messages/interleave-notices.ts +0 -80
- package/client/features/chat/messages/markdown-content.tsx +0 -89
- package/client/features/chat/messages/preview-turn.ts +0 -37
- package/client/features/chat/messages/shimmer-text.tsx +0 -20
- package/client/features/chat/messages/tool-group/code-block.tsx +0 -41
- package/client/features/chat/messages/tool-group/collapse.tsx +0 -28
- package/client/features/chat/messages/tool-group/detect.ts +0 -93
- package/client/features/chat/messages/tool-group/fixtures.ts +0 -309
- package/client/features/chat/messages/tool-group/format/claude.ts +0 -49
- package/client/features/chat/messages/tool-group/format/codex.ts +0 -130
- package/client/features/chat/messages/tool-group/format/hermes.ts +0 -69
- package/client/features/chat/messages/tool-group/format/index.ts +0 -34
- package/client/features/chat/messages/tool-group/format/mcp.ts +0 -68
- package/client/features/chat/messages/tool-group/format/openclaw.ts +0 -120
- package/client/features/chat/messages/tool-group/format/shared.ts +0 -49
- package/client/features/chat/messages/tool-group/format/shell.ts +0 -162
- package/client/features/chat/messages/tool-group/index.ts +0 -9
- package/client/features/chat/messages/tool-group/read-image-preview.tsx +0 -46
- package/client/features/chat/messages/tool-group/subagent-card.tsx +0 -138
- package/client/features/chat/messages/tool-group/timeline-row.tsx +0 -159
- package/client/features/chat/messages/tool-group/tool-call-group.tsx +0 -279
- package/client/features/chat/messages/tool-group/tool-output.tsx +0 -125
- package/client/features/chat/messages/turn-view.tsx +0 -270
- package/client/features/chat/messages/use-stick-to-bottom.ts +0 -96
- package/client/features/chat/messages/user-message-bubble.tsx +0 -63
- package/client/features/chat/sessions/api.ts +0 -193
- package/client/features/chat/sessions/chat-selector.tsx +0 -399
- package/client/features/chat/sessions/session-view.ts +0 -53
- package/client/features/chat/sessions/use-selected-session.ts +0 -171
- package/client/features/chat/use-chat.ts +0 -229
- package/client/features/collab/applet-api.ts +0 -35
- package/client/features/collab/components/cursors.tsx +0 -241
- package/client/features/collab/components/presence-avatars.tsx +0 -74
- package/client/features/collab/components/presence-frame.tsx +0 -122
- package/client/features/collab/components/presence-group.tsx +0 -31
- package/client/features/collab/components/presence-helpers.ts +0 -50
- package/client/features/collab/components/user-avatar-group.tsx +0 -35
- package/client/features/collab/components/user-avatar.tsx +0 -65
- package/client/features/collab/components/user.tsx +0 -69
- package/client/features/collab/host-state.ts +0 -160
- package/client/features/collab/index.ts +0 -5
- package/client/features/collab/local-user.ts +0 -46
- package/client/features/collab/members/api.ts +0 -17
- package/client/features/collab/members/hooks.ts +0 -97
- package/client/features/collab/members/store.ts +0 -148
- package/client/features/collab/members/types.ts +0 -55
- package/client/features/collab/presence/client.ts +0 -242
- package/client/features/collab/presence/hooks.tsx +0 -160
- package/client/features/collab/presence/presence-publisher.ts +0 -30
- package/client/features/collab/presence/presence-target.ts +0 -8
- package/client/features/collab/presence/provider.tsx +0 -74
- package/client/features/collab/presence/store.ts +0 -156
- package/client/features/collab/presence/users.ts +0 -87
- package/client/features/collab/proxy-user.ts +0 -28
- package/client/features/collab/sharing/agent-invite.tsx +0 -30
- package/client/features/collab/sharing/workspace-members.tsx +0 -269
- package/client/features/collab/sharing/workspace-sharing-menu.tsx +0 -179
- package/client/features/collab/testing/component-fixtures.tsx +0 -54
- package/client/features/collab/testing/fake-engine.ts +0 -120
- package/client/features/connectors/api.ts +0 -25
- package/client/features/connectors/icon-mcp.tsx +0 -21
- package/client/features/connectors/mcp-icons.ts +0 -183
- package/client/features/connectors/mcp-server-cards.tsx +0 -105
- package/client/features/connectors/read-connectors.ts +0 -35
- package/client/features/demo/demo-dialog.tsx +0 -194
- package/client/features/dev/blobatar-shapes-page.tsx +0 -344
- package/client/features/dev/chat-states-fixtures.ts +0 -755
- package/client/features/dev/chat-states-page.tsx +0 -476
- package/client/features/dev/collab/collab-page.tsx +0 -24
- package/client/features/dev/collab/collab-playground.tsx +0 -614
- package/client/features/dev/collab/local-user-settings.tsx +0 -120
- package/client/features/dev/collab/playground-room.ts +0 -33
- package/client/features/dev/dev-index-page.tsx +0 -83
- package/client/features/dev/dev-routes.tsx +0 -43
- package/client/features/dev/harness-debug-page.tsx +0 -607
- package/client/features/dev/onboarding-preview-page.tsx +0 -76
- package/client/features/dev/texture-lab-page.tsx +0 -149
- package/client/features/dev/tool-calls-page.tsx +0 -79
- package/client/features/dev/ui-components/ui-component-previews.tsx +0 -855
- package/client/features/dev/ui-components/ui-components-page.tsx +0 -60
- package/client/features/dev/workspace-setup-mocks.ts +0 -103
- package/client/features/dev/workspace-setup-page.tsx +0 -11
- package/client/features/dev/workspace-setup-preview.tsx +0 -249
- package/client/features/drawings/capture-element.ts +0 -57
- package/client/features/drawings/drawing-layer.tsx +0 -49
- package/client/features/drawings/drawing-toolbar.tsx +0 -95
- package/client/features/drawings/use-chat-annotation.ts +0 -228
- package/client/features/drawings/use-drawing-layer.ts +0 -756
- package/client/features/drawings/use-view-sketch.ts +0 -154
- package/client/features/harness/api.ts +0 -69
- package/client/features/harness/device-login-steps.tsx +0 -103
- package/client/features/harness/harness-login-panel.tsx +0 -232
- package/client/features/harness/harness-presentation.ts +0 -15
- package/client/features/harness/harness-selector.tsx +0 -119
- package/client/features/harness/use-harness-login.ts +0 -77
- package/client/features/home/api.ts +0 -135
- package/client/features/home/home-logo.tsx +0 -344
- package/client/features/home/home-page.tsx +0 -305
- package/client/features/home/shared-workspaces.tsx +0 -70
- package/client/features/home/workspace-invitations.tsx +0 -101
- package/client/features/home/workspace-preview.tsx +0 -213
- package/client/features/identity/host-api.ts +0 -35
- package/client/features/identity/store.ts +0 -26
- package/client/features/identity/types.ts +0 -41
- package/client/features/identity/use-identity.ts +0 -6
- package/client/features/onboarding/agent-setup-step.tsx +0 -57
- package/client/features/onboarding/api.ts +0 -42
- package/client/features/onboarding/onboarding-idea-disk.tsx +0 -129
- package/client/features/onboarding/onboarding-page.tsx +0 -33
- package/client/features/onboarding/onboarding-screen.tsx +0 -20
- package/client/features/onboarding/onboarding-status.tsx +0 -24
- package/client/features/onboarding/workspace-setup-step.tsx +0 -239
- package/client/features/overview/api.ts +0 -28
- package/client/features/overview/default/registry.tsx +0 -34
- package/client/features/overview/default/views-widget.tsx +0 -246
- package/client/features/overview/grid.ts +0 -77
- package/client/features/overview/hidden-panel.tsx +0 -111
- package/client/features/overview/overview.tsx +0 -299
- package/client/features/overview/use-grid-reconcile.ts +0 -94
- package/client/features/overview/widget-canvas.tsx +0 -166
- package/client/features/overview/widget-frame.tsx +0 -77
- package/client/features/overview/workspace-name.tsx +0 -55
- package/client/features/scratchpad/scratch-session.ts +0 -71
- package/client/features/scratchpad/scratchpad-controls.tsx +0 -516
- package/client/features/scratchpad/scratchpad.tsx +0 -360
- package/client/features/scratchpad/use-scratchpad-snapshot.tsx +0 -133
- package/client/features/update/api.ts +0 -35
- package/client/features/update/update-control.tsx +0 -102
- package/client/features/views/api.ts +0 -188
- package/client/features/views/pending-view-screen.tsx +0 -303
- package/client/features/views/use-view-actions.ts +0 -119
- package/client/features/views/use-view-drafts.ts +0 -88
- package/client/features/views/view-manager.tsx +0 -293
- package/client/features/views/view-presentation.ts +0 -12
- package/client/features/views/view-residency.ts +0 -77
- package/client/features/views/view-submission.ts +0 -56
- package/client/features/workspace/add/api.ts +0 -61
- package/client/features/workspace/add/create-workspace-dialog.tsx +0 -230
- package/client/features/workspace/add/import-workspace-dialog.tsx +0 -81
- package/client/features/workspace/add/use-workspace-import.ts +0 -61
- package/client/features/workspace/add/workspace-agent-options.ts +0 -53
- package/client/features/workspace/add/workspace-agent-selector.tsx +0 -96
- package/client/features/workspace/add/workspace-dialog-content.tsx +0 -22
- package/client/features/workspace/api.ts +0 -180
- package/client/features/workspace/harness-transition.ts +0 -81
- package/client/features/workspace/moi-context.ts +0 -129
- package/client/features/workspace/remote.ts +0 -34
- package/client/features/workspace/settings/api.ts +0 -112
- package/client/features/workspace/settings/connectors-settings.tsx +0 -110
- package/client/features/workspace/settings/environment-settings.tsx +0 -149
- package/client/features/workspace/settings/general-settings.tsx +0 -180
- package/client/features/workspace/settings/icon-picker-options.ts +0 -30
- package/client/features/workspace/settings/settings-layout.tsx +0 -53
- package/client/features/workspace/settings/use-env-vars.ts +0 -20
- package/client/features/workspace/settings/workspace-icon-picker.tsx +0 -318
- package/client/features/workspace/settings/workspace-settings-dialog.tsx +0 -65
- package/client/features/workspace/setup/workspace-login-state.tsx +0 -56
- package/client/features/workspace/setup/workspace-recovery-states.tsx +0 -142
- package/client/features/workspace/setup/workspace-setup.tsx +0 -98
- package/client/features/workspace/setup/workspace-welcome-state.tsx +0 -81
- package/client/features/workspace/tab-resolution.ts +0 -32
- package/client/features/workspace/theme-panel.tsx +0 -191
- package/client/features/workspace/unavailable-page.tsx +0 -21
- package/client/features/workspace/use-fits-split-layout.ts +0 -69
- package/client/features/workspace/use-workspace-navigation.ts +0 -265
- package/client/features/workspace/use-workspace-socket.ts +0 -51
- package/client/features/workspace/workspace-content.tsx +0 -597
- package/client/features/workspace/workspace-context.tsx +0 -21
- package/client/features/workspace/workspace-frame.tsx +0 -64
- package/client/features/workspace/workspace-identity.tsx +0 -40
- package/client/features/workspace/workspace-layout-context.tsx +0 -156
- package/client/features/workspace/workspace-menu.tsx +0 -67
- package/client/features/workspace/workspace-pane.tsx +0 -22
- package/client/features/workspace/workspace-pending-screen.tsx +0 -26
- package/client/features/workspace/workspace-preferences.ts +0 -91
- package/client/features/workspace/workspace-presentation.tsx +0 -35
- package/client/features/workspace/workspace-screen.tsx +0 -28
- package/client/features/workspace/workspace-split-layout.tsx +0 -116
- package/client/features/workspace/workspace-state.ts +0 -206
- package/client/features/workspace/workspace-tabs.tsx +0 -233
- package/client/features/workspace/workspace-test-utils.ts +0 -23
- package/client/global.d.ts +0 -5
- package/client/index.css +0 -247
- package/client/index.html +0 -81
- package/client/index.tsx +0 -45
- package/client/lib/agent-availability.ts +0 -14
- package/client/lib/browser-tab-id.ts +0 -4
- package/client/lib/cn.ts +0 -6
- package/client/lib/flags.ts +0 -11
- package/client/lib/identity-icon-registry.ts +0 -150
- package/client/lib/rate-limit.ts +0 -77
- package/client/lib/use-latest-ref.ts +0 -11
- package/client/lib/user-display-name.ts +0 -6
- package/client/lib/ws-url.ts +0 -10
- package/client/main.tsx +0 -43
- package/client/runtime/app-context.ts +0 -20
- package/client/runtime/app-events.ts +0 -75
- package/client/runtime/hmr-watchdog.ts +0 -39
- package/client/runtime/reconnecting-socket.ts +0 -115
- package/client/runtime/use-client-events.ts +0 -69
- package/client/runtime/workspace-theme.ts +0 -175
- package/client/store/ui.ts +0 -94
- package/client/store/workspace-session.ts +0 -30
- package/client/structured-clone-shim.ts +0 -14
- package/client/tailwind-config.ts +0 -43
- package/dist/chunk-851bx8ss.js +0 -72
- package/dist/chunk-cty37f3v.js +0 -1
- package/dist/chunk-dy6f6h3e.js +0 -5
- package/dist/chunk-j6928pwm.js +0 -1
- package/dist/chunk-kffcah9w.css +0 -1
- package/dist/chunk-rh58dc0y.js +0 -2
- package/lib/applet-selector.ts +0 -24
- package/lib/attachment-note.ts +0 -66
- package/lib/chat-title.ts +0 -11
- package/lib/collab/colors.ts +0 -30
- package/lib/collab/protocol.ts +0 -84
- package/lib/collab/types.ts +0 -52
- package/lib/default-widgets.ts +0 -32
- package/lib/events.ts +0 -61
- package/lib/format.ts +0 -348
- package/lib/harness-instructions.ts +0 -30
- package/lib/harness-types.ts +0 -13
- package/lib/identity-icons.ts +0 -73
- package/lib/ids.ts +0 -33
- package/lib/message-attachments.ts +0 -40
- package/lib/moi-attachments.ts +0 -204
- package/lib/moi-context.ts +0 -305
- package/lib/navigation.ts +0 -65
- package/lib/onboarding.ts +0 -41
- package/lib/scratchpad-skew.ts +0 -64
- package/lib/session-drafts.ts +0 -10
- package/lib/speed-mode.ts +0 -5
- package/lib/system-messages.ts +0 -241
- package/lib/themes.ts +0 -241
- package/lib/types.ts +0 -776
- package/lib/update.ts +0 -2
- package/lib/view-build-directives.ts +0 -11
- package/lib/workspace-config.ts +0 -48
- package/lib/workspace-icon.ts +0 -20
- package/lib/workspace-layout.ts +0 -15
- package/lib/workspace-name.ts +0 -17
- package/lib/workspace-tabs.ts +0 -29
- package/server/AGENTS.md +0 -17
- package/server/README.md +0 -123
- package/server/agent-caller.ts +0 -16
- package/server/agent-launcher.ts +0 -27
- package/server/api/harnesses.ts +0 -79
- package/server/api/index.ts +0 -1351
- package/server/api/onboarding.ts +0 -46
- package/server/app-config.ts +0 -264
- package/server/app-settings.ts +0 -69
- package/server/applets/api-base.ts +0 -4
- package/server/applets/applet-css.ts +0 -55
- package/server/applets/build-applet.ts +0 -475
- package/server/applets/build-worker.ts +0 -179
- package/server/applets/bundle-queue.ts +0 -19
- package/server/applets/config.ts +0 -226
- package/server/applets/declarations.ts +0 -45
- package/server/applets/dependencies.ts +0 -206
- package/server/applets/functions-worker.ts +0 -121
- package/server/applets/functions.ts +0 -392
- package/server/applets/index.ts +0 -504
- package/server/applets/log.ts +0 -149
- package/server/applets/runtime/collab.ts +0 -94
- package/server/applets/runtime/moi.ts +0 -35
- package/server/applets/runtime/rpc.ts +0 -15
- package/server/applets/thumbnails.ts +0 -200
- package/server/applets/typecheck.ts +0 -100
- package/server/applets/ui-components.ts +0 -241
- package/server/applets/view-source.ts +0 -73
- package/server/applets/views.ts +0 -323
- package/server/applets/widgets.ts +0 -181
- package/server/cli/applet-selector.ts +0 -19
- package/server/cli/args.ts +0 -5
- package/server/cli/colors.ts +0 -20
- package/server/cli/commands/bundle.ts +0 -119
- package/server/cli/commands/call-server-fn.ts +0 -42
- package/server/cli/commands/check.ts +0 -53
- package/server/cli/commands/config.ts +0 -120
- package/server/cli/commands/debug.ts +0 -119
- package/server/cli/commands/env.ts +0 -162
- package/server/cli/commands/hermes.ts +0 -149
- package/server/cli/commands/init.ts +0 -323
- package/server/cli/commands/navigate.ts +0 -35
- package/server/cli/commands/openclaw.ts +0 -168
- package/server/cli/commands/refresh.ts +0 -45
- package/server/cli/commands/remote.ts +0 -330
- package/server/cli/commands/scratch.ts +0 -496
- package/server/cli/commands/service.ts +0 -298
- package/server/cli/commands/skill.ts +0 -121
- package/server/cli/commands/start.ts +0 -112
- package/server/cli/commands/status.ts +0 -80
- package/server/cli/commands/tabs.ts +0 -36
- package/server/cli/commands/theme.ts +0 -192
- package/server/cli/commands/ui-components.ts +0 -15
- package/server/cli/commands/update.ts +0 -192
- package/server/cli/commands/version.ts +0 -9
- package/server/cli/commands/views.ts +0 -87
- package/server/cli/control.ts +0 -120
- package/server/cli/env.ts +0 -259
- package/server/cli/index.ts +0 -175
- package/server/cli/pc.ts +0 -20
- package/server/cli/provider.ts +0 -25
- package/server/cli/remote-command.ts +0 -77
- package/server/cli/remote-control.ts +0 -73
- package/server/cli/remote-operations.ts +0 -247
- package/server/cli/server-version.ts +0 -16
- package/server/cli/server.ts +0 -93
- package/server/cli/ui-components.ts +0 -294
- package/server/cli/ui.ts +0 -52
- package/server/cli.ts +0 -3
- package/server/collab/cloudflare-access.ts +0 -78
- package/server/collab/config.ts +0 -13
- package/server/collab/manager.ts +0 -413
- package/server/collab/service.ts +0 -136
- package/server/collab/skill/index.ts +0 -7
- package/server/collab/worker-messages.ts +0 -10
- package/server/collab/worker.ts +0 -52
- package/server/constants.ts +0 -13
- package/server/control-client.ts +0 -124
- package/server/control.ts +0 -572
- package/server/data-dir.ts +0 -22
- package/server/debug.ts +0 -10
- package/server/events.ts +0 -25
- package/server/harness/README.md +0 -381
- package/server/harness/acp/NOTES.md +0 -426
- package/server/harness/acp/adapter.ts +0 -206
- package/server/harness/acp/archived.ts +0 -88
- package/server/harness/acp/client.ts +0 -329
- package/server/harness/acp/discovery.ts +0 -127
- package/server/harness/acp/model-state.ts +0 -57
- package/server/harness/acp/run-durations.ts +0 -68
- package/server/harness/acp/session.ts +0 -786
- package/server/harness/acp/wire.ts +0 -132
- package/server/harness/auth.ts +0 -272
- package/server/harness/claude-code/NOTES.md +0 -651
- package/server/harness/claude-code/adapter.ts +0 -876
- package/server/harness/claude-code/auth.ts +0 -178
- package/server/harness/claude-code/cli.ts +0 -42
- package/server/harness/claude-code/git-worktree.ts +0 -35
- package/server/harness/claude-code/index.ts +0 -171
- package/server/harness/claude-code/mcp.ts +0 -152
- package/server/harness/claude-code/models.ts +0 -102
- package/server/harness/claude-code/permissions.ts +0 -34
- package/server/harness/claude-code/run-action.ts +0 -123
- package/server/harness/claude-code/session-title.ts +0 -104
- package/server/harness/claude-code/session.ts +0 -969
- package/server/harness/claude-code/sessions.ts +0 -153
- package/server/harness/codex/NOTES.md +0 -259
- package/server/harness/codex/adapter.ts +0 -633
- package/server/harness/codex/auth.ts +0 -140
- package/server/harness/codex/client.ts +0 -439
- package/server/harness/codex/connectors.ts +0 -92
- package/server/harness/codex/discovery.ts +0 -106
- package/server/harness/codex/index.ts +0 -107
- package/server/harness/codex/pagination.ts +0 -27
- package/server/harness/codex/permissions.ts +0 -80
- package/server/harness/codex/probe.ts +0 -183
- package/server/harness/codex/run-action.ts +0 -93
- package/server/harness/codex/session-title.ts +0 -147
- package/server/harness/codex/session.ts +0 -1196
- package/server/harness/codex/status.ts +0 -31
- package/server/harness/codex/thread-list.ts +0 -78
- package/server/harness/codex/transport.ts +0 -191
- package/server/harness/command.ts +0 -45
- package/server/harness/debug.ts +0 -57
- package/server/harness/detect.ts +0 -164
- package/server/harness/executable.ts +0 -125
- package/server/harness/fork.ts +0 -14
- package/server/harness/hermes/NOTES.md +0 -833
- package/server/harness/hermes/discovery.ts +0 -175
- package/server/harness/hermes/index.ts +0 -167
- package/server/harness/hermes/models.ts +0 -99
- package/server/harness/install.ts +0 -49
- package/server/harness/openclaw/NOTES.md +0 -749
- package/server/harness/openclaw/adapter.ts +0 -336
- package/server/harness/openclaw/compat.ts +0 -95
- package/server/harness/openclaw/cron-view.ts +0 -78
- package/server/harness/openclaw/discovery.ts +0 -456
- package/server/harness/openclaw/gateway.ts +0 -467
- package/server/harness/openclaw/index.ts +0 -125
- package/server/harness/openclaw/session.ts +0 -1512
- package/server/harness/openclaw/strip.ts +0 -184
- package/server/harness/openclaw/thinking.ts +0 -150
- package/server/harness/registry.ts +0 -39
- package/server/harness/run-action.ts +0 -85
- package/server/harness/session-title.ts +0 -59
- package/server/harness/shell-path.ts +0 -89
- package/server/harness/types.ts +0 -170
- package/server/navigation-relay.ts +0 -110
- package/server/onboarding/brief.ts +0 -29
- package/server/onboarding/ideas.ts +0 -48
- package/server/onboarding/jobs.ts +0 -291
- package/server/open-browser.ts +0 -7
- package/server/operations/commands.ts +0 -46
- package/server/operations/files.ts +0 -148
- package/server/operations/server.ts +0 -206
- package/server/remote/agent.ts +0 -103
- package/server/remote/broker-client.ts +0 -76
- package/server/remote/broker.ts +0 -81
- package/server/remote/client.ts +0 -725
- package/server/remote/errors.ts +0 -2
- package/server/remote/routes.ts +0 -121
- package/server/remote/workspace.ts +0 -34
- package/server/scratchpad/assets.ts +0 -258
- package/server/scratchpad/document.ts +0 -312
- package/server/scratchpad/executor.ts +0 -499
- package/server/scratchpad/relay.ts +0 -44
- package/server/scratchpad/shape-defaults.ts +0 -82
- package/server/server-cwd.ts +0 -23
- package/server/service.ts +0 -800
- package/server/sessions/archive.ts +0 -23
- package/server/sessions/attachment-message.ts +0 -95
- package/server/sessions/config.ts +0 -45
- package/server/sessions/lifecycle.ts +0 -19
- package/server/sessions/pending-views.ts +0 -158
- package/server/sessions/selected.ts +0 -113
- package/server/sessions/send-message.ts +0 -102
- package/server/sessions/store.ts +0 -54
- package/server/sessions/view-sessions.ts +0 -192
- package/server/skills/locations.ts +0 -82
- package/server/skills/lock.ts +0 -29
- package/server/skills/template.ts +0 -94
- package/server/skills/update.ts +0 -94
- package/server/skills/version.ts +0 -129
- package/server/skills/workspace.ts +0 -121
- package/server/state.ts +0 -40
- package/server/static.ts +0 -25
- package/server/status.ts +0 -110
- package/server/tldraw-package.d.ts +0 -4
- package/server/update.ts +0 -429
- package/server/uploads.ts +0 -290
- package/server/vendor.ts +0 -63
- package/server/version.ts +0 -41
- package/server/web.ts +0 -350
- package/server/workspace-state/file.ts +0 -181
- package/server/workspace-state/index.ts +0 -169
- package/server/workspace-state/lock.ts +0 -42
- package/server/workspace-state/types.ts +0 -16
- package/server/workspaces/api.ts +0 -24
- package/server/workspaces/change-harness.ts +0 -77
- package/server/workspaces/config.ts +0 -42
- package/server/workspaces/env-apply.ts +0 -20
- package/server/workspaces/env.ts +0 -424
- package/server/workspaces/harness-transition.ts +0 -29
- package/server/workspaces/icon.ts +0 -13
- package/server/workspaces/import.ts +0 -74
- package/server/workspaces/init.ts +0 -74
- package/server/workspaces/layout.ts +0 -190
- package/server/workspaces/preview.ts +0 -72
- package/server/workspaces/registry.ts +0 -330
- package/server/workspaces/required-env.ts +0 -19
- package/server/workspaces/scaffold.ts +0 -189
- package/server/workspaces/shared.ts +0 -74
- package/server/workspaces/tabs.ts +0 -35
- package/server/workspaces/theme.ts +0 -58
- package/tsconfig.json +0 -20
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Se,rt,j,nt,v,he,on}from"./chunk-kjp60rqs.js";import{Be,fr}from"./chunk-sdyqhxe1.js";import{Oe}from"./chunk-w1fx9tsc.js";import{g,e,n}from"./chunk-7c0zbz74.js";var je=e(function(Sn,gt){var pe=/[\t\n\f\r "#'()/;[\\\]{}]/g,de=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,fs=/.[\r\n"'(/\\]/,mt=/[\da-f]/i;gt.exports=function(r,s={}){let i=r.css.valueOf(),o=s.ignoreErrors,l,u,a,f,h,m,c,d,y,b,E=i.length,p=0,O=[],k=[],H=-1;function C(){return p}function I(L){throw r.error("Unclosed "+L,p)}function M(){return k.length===0&&p>=E}function Ue(L){if(k.length)return k.pop();if(p>=E)return;let $e=L?L.ignoreUnclosed:!1;switch(l=i.charCodeAt(p),l){case 10:case 32:case 9:case 13:case 12:{f=p;do f+=1,l=i.charCodeAt(f);while(l===32||l===10||l===9||l===13||l===12);m=["space",i.slice(p,f)],p=f-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let dt=String.fromCharCode(l);m=[dt,dt,p];break}case 40:{if(b=O.length?O.pop()[1]:"",y=i.charCodeAt(p+1),b==="url"&&y!==39&&y!==34&&y!==32&&y!==10&&y!==9&&y!==12&&y!==13){f=p;do{if(c=!1,f=i.indexOf(")",f+1),f===-1)if(o||$e){f=p;break}else I("bracket");d=f;while(i.charCodeAt(d-1)===92)d-=1,c=!c}while(c);m=["brackets",i.slice(p,f+1),p,f],p=f}else if(p<=H)m=["(","(",p];else if(f=i.indexOf(")",p+1),u=i.slice(p,f+1),f===-1||fs.test(u))H=f===-1?E:f,m=["(","(",p];else m=["brackets",u,p,f],p=f;break}case 39:case 34:{h=l===39?"'":'"',f=p;do{if(c=!1,f=i.indexOf(h,f+1),f===-1)if(o||$e){f=p+1;break}else I("string");d=f;while(i.charCodeAt(d-1)===92)d-=1,c=!c}while(c);m=["string",i.slice(p,f+1),p,f],p=f;break}case 64:{if(pe.lastIndex=p+1,pe.test(i),pe.lastIndex===0)f=i.length-1;else f=pe.lastIndex-2;m=["at-word",i.slice(p,f+1),p,f],p=f;break}case 92:{f=p,a=!0;while(i.charCodeAt(f+1)===92)f+=1,a=!a;if(l=i.charCodeAt(f+1),a&&l!==47&&l!==32&&l!==10&&l!==9&&l!==13&&l!==12){if(f+=1,mt.test(i.charAt(f))){while(mt.test(i.charAt(f+1)))f+=1;if(i.charCodeAt(f+1)===32)f+=1}}m=["word",i.slice(p,f+1),p,f],p=f;break}default:{if(l===47&&i.charCodeAt(p+1)===42){if(f=i.indexOf("*/",p+2)+1,f===0)if(o||$e)f=i.length;else I("comment");m=["comment",i.slice(p,f+1),p,f],p=f}else{if(de.lastIndex=p+1,de.test(i),de.lastIndex===0)f=i.length-1;else f=de.lastIndex-2;m=["word",i.slice(p,f+1),p,f],O.push(m),p=f}break}}return p++,m}function G(L){k.push(L)}return{back:G,endOfFile:M,nextToken:Ue,position:C}}});var De=e(function(bn,xt){var w=Oe(),cs=je(),yt;function hs(t){yt=t}var ps={";":w.yellow,":":w.yellow,"(":w.cyan,")":w.cyan,"[":w.yellow,"]":w.yellow,"{":w.yellow,"}":w.yellow,"at-word":w.cyan,brackets:w.cyan,call:w.cyan,class:w.yellow,comment:w.gray,hash:w.magenta,string:w.green};function ds([t,r],s){if(t==="word"){if(r[0]===".")return"class";if(r[0]==="#")return"hash"}if(!s.endOfFile()){let i=s.nextToken();if(s.back(i),i[0]==="brackets"||i[0]==="(")return"call"}return t}function wt(t){let r=cs(new yt(t),{ignoreErrors:!0}),s="";while(!r.endOfFile()){let i=r.nextToken(),o=ps[ds(i,r)];if(o)s+=i[1].split(/\r?\n/).map((l)=>o(l)).join(`
|
|
3
|
+
`);else s+=i[1]}return s}wt.registerInput=hs;xt.exports=wt});var ge=e(function(vn,bt){var me=Oe(),St=De();class K extends Error{constructor(t,r,s,i,o,l){super(t);if(this.name="CssSyntaxError",this.reason=t,o)this.file=o;if(i)this.source=i;if(l)this.plugin=l;if(typeof r<"u"&&typeof s<"u")if(typeof r==="number")this.line=r,this.column=s;else this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,K)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let r=this.source;if(t==null)t=me.isColorSupported;let s=(h)=>h,i=(h)=>h,o=(h)=>h;if(t){let{bold:h,gray:m,red:c}=me.createColors(!0);if(i=(d)=>h(c(d)),s=(d)=>m(d),St)o=(d)=>St(d)}let l=r.split(/\r?\n/),u=Math.max(this.line-3,0),a=Math.min(this.line+2,l.length),f=String(a).length;return l.slice(u,a).map((h,m)=>{let c=u+1+m,d=" "+(" "+c).slice(-f)+" | ";if(c===this.line){if(h.length>160){let b=20,E=Math.max(0,this.column-b),p=Math.max(this.column+b,this.endColumn+b),O=h.slice(E,p),k=s(d.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,b-1)).replace(/[^\t]/g," ");return i(">")+s(d)+o(O)+`
|
|
4
|
+
`+k+i("^")}let y=s(d.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(d)+o(h)+`
|
|
5
|
+
`+y+i("^")}return" "+s(d)+o(h)}).join(`
|
|
6
|
+
`)}toString(){let t=this.showSourceCode();if(t)t=`
|
|
7
|
+
|
|
8
|
+
`+t+`
|
|
9
|
+
`;return this.name+": "+this.message+t}}bt.exports=K;K.default=K});var Fe=e(function(Cn,At){var ms=/(<)(\/?style\b)/gi,gs=/(<)(!--)/g,ys=/[\t\n\f\r "#'()/;[\\\]{}]/;function A(t){if(typeof t!=="string")return t;if(!t.includes("<"))return t;return t.replace(ms,"\\3c $2").replace(gs,"\\3c $2")}var vt={after:`
|
|
10
|
+
`,beforeClose:`
|
|
11
|
+
`,beforeComment:`
|
|
12
|
+
`,beforeDecl:`
|
|
13
|
+
`,beforeOpen:" ",beforeRule:`
|
|
14
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function ws(t){return t[0].toUpperCase()+t.slice(1)}function Ct(t,r){let s="@"+r.name,i=r.params?t.rawValue(r,"params"):"",o=r.raws.afterName;if(typeof o>"u")o=i?" ":"";else if(o===""&&i&&!ys.test(i[0]))o=" ";return s+o+i}function xs(t){if(!t.prop.startsWith("--"))return!1;let r=t.raws.before;return typeof r>"u"||!/\S$/.test(r)}function Ot(t,r,s){let i=s.nodes,o=i.length-1;while(o>0){if(i[o].type!=="comment")break;o-=1}let l=t.raw(s,"semicolon"),u=s.type==="document";for(let a=i.length-1;a>=0;a--){let f=i[a],h=o!==a||l;if(!h&&a<i.length-1&&(f.type==="atrule"&&!f.nodes||f.type==="decl"&&xs(f)))h=!0;r.push({document:u,node:f,semicolon:h})}}function Et(t,r,s,i){let o=t.raw(s,"between","beforeOpen");t.builder(A(i+o)+"{",s,"start");let l=s.nodes&&s.nodes.length,u=()=>{let a=l?t.raw(s,"after"):t.raw(s,"after","emptyBody");if(a)t.builder(A(a));if(t.builder("}",s,"end"),s.type==="rule"&&s.raws.ownSemicolon)t.builder(A(s.raws.ownSemicolon),s,"end")};if(l)r.push(u),Ot(t,r,s);else u()}class Q{constructor(t){this.builder=t}atrule(t,r){let s=Ct(this,t);if(t.nodes)this.block(t,s);else{let i=(t.raws.between||"")+(r?";":"");this.builder(A(s+i),t)}}beforeAfter(t,r){let s;if(t.type==="decl")s=this.raw(t,null,"beforeDecl");else if(t.type==="comment")s=this.raw(t,null,"beforeComment");else if(r==="before")s=this.raw(t,null,"beforeRule");else s=this.raw(t,null,"beforeClose");let i=t.parent,o=0;while(i&&i.type!=="root")o+=1,i=i.parent;if(s.includes(`
|
|
15
|
+
`)){let l=this.raw(t,null,"indent");if(l.length)for(let u=0;u<o;u++)s+=l}return s}block(t,r){let s=this.raw(t,"between","beforeOpen");this.builder(A(r+s)+"{",t,"start");let i;if(t.nodes&&t.nodes.length)this.body(t),i=this.raw(t,"after");else i=this.raw(t,"after","emptyBody");if(i)this.builder(A(i));this.builder("}",t,"end")}body(t){let r=Q.prototype,s=["atrule","block","body","rule","stringify"].every((o)=>this[o]===r[o]),i=[];Ot(this,i,t);while(i.length>0){let o=i.pop();if(typeof o==="function"){o();continue}let l=o.node,u=this.raw(l,"before");if(u)this.builder(o.document?u:A(u));if(s&&l.type==="rule")Et(this,i,l,this.rawValue(l,"selector"));else if(s&&l.type==="atrule"&&l.nodes)Et(this,i,l,Ct(this,l));else this.stringify(l,o.semicolon)}}comment(t){let r=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder(A("/*"+r+t.text+s+"*/"),t)}decl(t,r){let s=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");if(t.important)o+=s.important||" !important";if(r)o+=";";this.builder(A(o),t)}document(t){this.body(t)}raw(t,r,s){let i;if(!s)s=r;if(r){if(i=t.raws[r],typeof i<"u")return i}let o=t.parent;if(s==="before"){if(!o||o.type==="root"&&o.first===t)return"";if(o&&o.type==="document")return""}if(!o)return vt[s];let l=t.root(),u=l.rawCache||(l.rawCache={});if(typeof u[s]<"u")return u[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);else{let a="raw"+ws(s);if(this[a])i=this[a](l,t);else l.walk((f)=>{if(i=f.raws[r],typeof i<"u")return!1})}if(typeof i>"u")i=vt[s];return u[s]=i,i}rawBeforeClose(t){let r;if(t.walk((s)=>{if(s.nodes&&s.nodes.length>0){if(typeof s.raws.after<"u"){if(r=s.raws.after,r.includes(`
|
|
16
|
+
`))r=r.replace(/[^\n]+$/,"");return!1}}}),r)r=r.replace(/\S/g,"");return r}rawBeforeComment(t,r){let s;if(t.walkComments((i)=>{if(typeof i.raws.before<"u"){if(s=i.raws.before,s.includes(`
|
|
17
|
+
`))s=s.replace(/[^\n]+$/,"");return!1}}),typeof s>"u")s=this.raw(r,null,"beforeDecl");else if(s)s=s.replace(/\S/g,"");return s}rawBeforeDecl(t,r){let s;if(t.walkDecls((i)=>{if(typeof i.raws.before<"u"){if(s=i.raws.before,s.includes(`
|
|
18
|
+
`))s=s.replace(/[^\n]+$/,"");return!1}}),typeof s>"u")s=this.raw(r,null,"beforeRule");else if(s)s=s.replace(/\S/g,"");return s}rawBeforeOpen(t){let r;return t.walk((s)=>{if(s.type!=="decl"){if(r=s.raws.between,typeof r<"u")return!1}}),r}rawBeforeRule(t){let r;if(t.walk((s)=>{if(s.nodes&&(s.parent!==t||t.first!==s)){if(typeof s.raws.before<"u"){if(r=s.raws.before,r.includes(`
|
|
19
|
+
`))r=r.replace(/[^\n]+$/,"");return!1}}}),r)r=r.replace(/\S/g,"");return r}rawColon(t){let r;return t.walkDecls((s)=>{if(typeof s.raws.between<"u")return r=s.raws.between.replace(/[^\s:]/g,""),!1}),r}rawEmptyBody(t){let r;return t.walk((s)=>{if(s.nodes&&s.nodes.length===0){if(r=s.raws.after,typeof r<"u")return!1}}),r}rawIndent(t){if(t.raws.indent)return t.raws.indent;let r;return t.walk((s)=>{let i=s.parent;if(i&&i!==t&&i.parent&&i.parent===t){if(typeof s.raws.before<"u"){let o=s.raws.before.split(`
|
|
20
|
+
`);return r=o[o.length-1],r=r.replace(/\S/g,""),!1}}}),r}rawSemicolon(t){let r;return t.walk((s)=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"){if(r=s.raws.semicolon,typeof r<"u")return!1}}),r}rawValue(t,r){let s=t[r],i=t.raws[r];if(i&&i.value===s)return i.raw;return s}root(t){if(t.source&&t.source.input.hasBOM)this.builder("\uFEFF",t,"start");if(this.body(t),t.raws.after){let r=t.raws.after,s=t.parent&&t.parent.type==="document";this.builder(s?r:A(r))}}rule(t){if(this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon)this.builder(A(t.raws.ownSemicolon),t,"end")}stringify(t,r){if(!this[t.type])throw Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)}}At.exports=Q;Q.default=Q});var Y=e(function(En,Pt){var Ss=Fe();function We(t,r){new Ss(r).stringify(t)}Pt.exports=We;We.default=We});var X=e(function(bs,ze){bs.isClean=Symbol("isClean");bs.my=Symbol("my")});var ee=e(function(On,Rt){var Es=ge(),Os=Fe(),As=Y(),{isClean:Z,my:Ps}=X();function Rs(t,r){let s=new t.constructor,i=[[t,s,r]];while(i.length>0){let[o,l,u]=i.pop();for(let a in o){if(!Object.prototype.hasOwnProperty.call(o,a))continue;if(a==="proxyCache")continue;let f=o[a],h=typeof f;if(a==="parent"&&h==="object"){if(u)l[a]=u}else if(a==="source")l[a]=f;else if(Array.isArray(f)){let m=[];l[a]=m;for(let c of f){let d=new c.constructor;m.push(d),i.push([c,d,l])}}else{if(h==="object"&&f!==null){let m=new f.constructor;i.push([f,m,void 0]),f=m}l[a]=f}}}return s}function B(t,r){if(r&&typeof r.offset<"u")return r.offset;let s=1,i=1,o=0;for(let l=0;l<t.length;l++){if(i===r.line&&s===r.column){o=l;break}if(t[l]===`
|
|
21
|
+
`)s=1,i+=1;else s+=1}return o}class q{get proxyOf(){return this}constructor(t={}){this.raws={},this[Z]=!1,this[Ps]=!0;for(let r of Object.keys(t)){if(r==="__proto__")continue;if(r==="nodes"){this.nodes=[];for(let s of t[r])if(typeof s.clone==="function"&&s.parent)this.append(s.clone());else this.append(s)}else this[r]=t[r]}}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${r.input.from}:${r.start.line}:${r.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let r in t)this[r]=t[r];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){if(delete this.raws.before,delete this.raws.after,!t)delete this.raws.between}clone(t={}){let r=Rs(this);for(let s in t)r[s]=t[s];return r}cloneAfter(t={}){let r=this.clone(t);return this.parent.insertAfter(this,r),r}cloneBefore(t={}){let r=this.clone(t);return this.parent.insertBefore(this,r),r}error(t,r={}){if(this.source){let{end:s,start:i}=this.rangeBy(r);return this.source.input.error(t,{column:i.column,line:i.line},{column:s.column,line:s.line},r)}return new Es(t)}getProxyProcessor(){return{get(t,r){if(r==="proxyOf")return t;else if(r==="root")return()=>t.root().toProxy();else return t[r]},set(t,r,s){if(t[r]===s)return!0;if(t[r]=s,r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")t.markDirty();return!0}}}markClean(){this[Z]=!0}markDirty(){if(this[Z]){this[Z]=!1;let t=this;while(t=t.parent)t[Z]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let r="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:B(r,this.source.start)};if(t.index)s=this.positionInside(t.index);else if(t.word){let o=r.slice(B(r,this.source.start),B(r,this.source.end)).indexOf(t.word);if(o!==-1)s=this.positionInside(o)}return s}positionInside(t){let r=this.source.start.column,s=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=B(i,this.source.start),l=o+t;for(let u=o;u<l;u++)if(i[u]===`
|
|
22
|
+
`)r=1,s+=1;else r+=1;return{column:r,line:s,offset:l}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let r="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:B(r,this.source.start)},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset==="number"?this.source.end.offset:B(r,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let l=r.slice(B(r,this.source.start),B(r,this.source.end)).indexOf(t.word);if(l!==-1)s=this.positionInside(l),i=this.positionInside(l+t.word.length)}else{if(t.start)s={column:t.start.column,line:t.start.line,offset:B(r,t.start)};else if(typeof t.index==="number")s=this.positionInside(t.index);if(t.end)i={column:t.end.column,line:t.end.line,offset:B(r,t.end)};else if(typeof t.endIndex==="number")i=this.positionInside(t.endIndex);else if(typeof t.index==="number")i=this.positionInside(t.index+1)}if(i.line<s.line||i.line===s.line&&i.column<=s.column)i={column:s.column+1,line:s.line,offset:s.offset+1};return{end:i,start:s}}raw(t,r){return new Os().raw(this,t,r)}remove(){if(this.parent)this.parent.removeChild(this);return this.parent=void 0,this}replaceWith(...t){if(this.parent){let r=this,s=!1;for(let i of t)if(i===this)s=!0;else if(s)this.parent.insertAfter(r,i),r=i;else this.parent.insertBefore(r,i);if(!s)this.remove()}return this}root(){let t=this;while(t.parent&&t.parent.type!=="document")t=t.parent;return t}toJSON(t,r){let s=r==null;r=r||new Map;let i=[],o=[[this,i,0]];for(let u=0;u<o.length;u++){let[a,f,h]=o[u],m={};f[h]=m;for(let c in a){if(!Object.prototype.hasOwnProperty.call(a,c))continue;if(c==="parent"||c==="proxyCache")continue;let d=a[c];if(Array.isArray(d)){let y=[];m[c]=y;for(let b=0;b<d.length;b++){let E=d[b];if(typeof E==="object"&&E.toJSON)if(E.toJSON===q.prototype.toJSON)o.push([E,y,b]);else y[b]=E.toJSON(null,r);else y[b]=E}}else if(typeof d==="object"&&d.toJSON)if(d.toJSON===q.prototype.toJSON)o.push([d,m,c]);else m[c]=d.toJSON(null,r);else if(c==="source"){if(d==null)continue;let y=r.get(d.input);if(y==null)y=r.size,r.set(d.input,y);m[c]={end:d.end,inputId:y,start:d.start}}else m[c]=d}}let l=i[0];if(s)l.inputs=[...r.keys()].map((u)=>u.toJSON());return l}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(t=As){if(t.stringify)t=t.stringify;let r="";return t(this,(s)=>{r+=s}),r}warn(t,r,s={}){let i={node:this};for(let o in s)i[o]=s[o];return t.warn(r,i)}}Rt.exports=q;q.default=q});var te=e(function(An,kt){var ks=ee();class ye extends ks{constructor(t){super(t);this.type="comment"}}kt.exports=ye;ye.default=ye});var re=e(function(Pn,It){var Is=ee();class we extends Is{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){if(t&&typeof t.value<"u"&&typeof t.value!=="string")t={...t,value:String(t.value)};super(t);this.type="decl"}}It.exports=we;we.default=we});var N=e(function(Rn,_t){var Ve=te(),He=re(),Je=ee(),{isClean:Bt,my:Lt}=X(),Ge,Nt,Mt,Ke;function Bs(t){let r=t.slice();while(r.length>0){let s=r.pop();if(delete s.source,s.nodes){s.nodes=s.nodes.slice();for(let i of s.nodes)r.push(i)}}return t.slice()}function Ls(t){let r=[t];while(r.length>0){let s=r.pop();if(s[Bt]=!1,s.proxyOf.nodes)for(let i of s.proxyOf.nodes)r.push(i)}}class P extends Je{get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let r of t){let s=this.normalize(r,this.last);for(let i of s)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){let r=[this];while(r.length>0){let s=r.pop();if(s!==this&&s.cleanRaws!==P.prototype.cleanRaws){s.cleanRaws(t);continue}if(Je.prototype.cleanRaws.call(s,t),s.nodes)for(let i of s.nodes)r.push(i)}}each(t){if(!this.proxyOf.nodes)return;let r=this.getIterator(),s,i;while(this.indexes[r]<this.proxyOf.nodes.length){if(s=this.indexes[r],i=t(this.proxyOf.nodes[s],s),i===!1)break;this.indexes[r]+=1}return delete this.indexes[r],i}every(t){return this.nodes.every(t)}getIterator(){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,r){if(r==="proxyOf")return t;else if(!t[r])return t[r];else if(r==="each"||typeof r==="string"&&r.startsWith("walk"))return(...s)=>t[r](...s.map((i)=>{if(typeof i==="function")return(o,l)=>i(o.toProxy(),l);else return i}));else if(r==="every"||r==="some")return(s)=>t[r]((i,...o)=>s(i.toProxy(),...o));else if(r==="root")return()=>t.root().toProxy();else if(r==="nodes")return t.nodes.map((s)=>s.toProxy());else if(r==="first"||r==="last")return t[r].toProxy();else return t[r]},set(t,r,s){if(t[r]===s)return!0;if(t[r]=s,r==="name"||r==="params"||r==="selector")t.markDirty();return!0}}}index(t){if(typeof t==="number")return t;if(t.proxyOf)t=t.proxyOf;return this.proxyOf.nodes.indexOf(t)}insertAfter(t,r){let s=this.index(t),i=this.normalize(r,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let l of i)this.proxyOf.nodes.splice(s+1,0,l);let o;for(let l in this.indexes)if(o=this.indexes[l],s<o)this.indexes[l]=o+i.length;return this.markDirty(),this}insertBefore(t,r){let s=this.index(t),i=s===0?"prepend":!1,o=this.normalize(r,this.proxyOf.nodes[s],i).reverse();s=this.index(t);for(let u of o)this.proxyOf.nodes.splice(s,0,u);let l;for(let u in this.indexes)if(l=this.indexes[u],s<=l)this.indexes[u]=l+o.length;return this.markDirty(),this}normalize(t,r){if(typeof t==="string")t=Bs(Nt(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)if(i.parent)i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)if(i.parent)i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw Error("Value field is missed in node creation");else if(typeof t.value!=="string")t.value=String(t.value);t=[new He(t)]}else if(t.selector||t.selectors)t=[new Ke(t)];else if(t.name)t=[new Ge(t)];else if(t.text)t=[new Ve(t)];else throw Error("Unknown node type in node creation");return t.map((i)=>{if(!i[Lt])P.rebuild(i);if(i=i.proxyOf,i.parent)i.parent.removeChild(i);if(i[Bt])Ls(i);if(!i.raws)i.raws={};if(typeof i.raws.before>"u"){if(r&&typeof r.raws.before<"u")i.raws.before=r.raws.before.replace(/\S/g,"")}return i.parent=this.proxyOf,i})}prepend(...t){t=t.reverse();for(let r of t){let s=this.normalize(r,this.first,"prepend").reverse();for(let i of s)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+s.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let r;for(let s in this.indexes)if(r=this.indexes[s],r>=t)this.indexes[s]=r-1;return this.markDirty(),this}replaceValues(t,r,s){if(!s)s=r,r={};return this.walkDecls((i)=>{if(r.props&&!r.props.includes(i.prop))return;if(r.fast&&!i.value.includes(r.fast))return;i.value=i.value.replace(t,s)}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let r=[{iterator:this.getIterator(),node:this.proxyOf}];while(r.length>0){let{iterator:s,node:i}=r[r.length-1],o=i.indexes[s];if(o>=i.proxyOf.nodes.length){delete i.indexes[s],r.pop();let a=r[r.length-1];if(a)a.node.indexes[a.iterator]+=1;continue}let l=i.proxyOf.nodes[o],u;try{u=t(l,o)}catch(a){throw l.addToError(a)}if(u===!1){for(let a of r)delete a.node.indexes[a.iterator];return!1}if(l.walk&&l.proxyOf.nodes)r.push({iterator:l.getIterator(),node:l});else i.indexes[s]+=1}return}walkAtRules(t,r){if(!r)return r=t,this.walk((s,i)=>{if(s.type==="atrule")return r(s,i)});if(t instanceof RegExp)return this.walk((s,i)=>{if(s.type==="atrule"&&t.test(s.name))return r(s,i)});return this.walk((s,i)=>{if(s.type==="atrule"&&s.name===t)return r(s,i)})}walkComments(t){return this.walk((r,s)=>{if(r.type==="comment")return t(r,s)})}walkDecls(t,r){if(!r)return r=t,this.walk((s,i)=>{if(s.type==="decl")return r(s,i)});if(t instanceof RegExp)return this.walk((s,i)=>{if(s.type==="decl"&&t.test(s.prop))return r(s,i)});return this.walk((s,i)=>{if(s.type==="decl"&&s.prop===t)return r(s,i)})}walkRules(t,r){if(!r)return r=t,this.walk((s,i)=>{if(s.type==="rule")return r(s,i)});if(t instanceof RegExp)return this.walk((s,i)=>{if(s.type==="rule"&&t.test(s.selector))return r(s,i)});return this.walk((s,i)=>{if(s.type==="rule"&&s.selector===t)return r(s,i)})}}P.registerParse=(t)=>{Nt=t};P.registerRule=(t)=>{Ke=t};P.registerAtRule=(t)=>{Ge=t};P.registerRoot=(t)=>{Mt=t};_t.exports=P;P.default=P;P.rebuild=(t)=>{let r=[t];while(r.length>0){let s=r.pop();if(s.type==="atrule")Object.setPrototypeOf(s,Ge.prototype);else if(s.type==="rule")Object.setPrototypeOf(s,Ke.prototype);else if(s.type==="decl")Object.setPrototypeOf(s,He.prototype);else if(s.type==="comment")Object.setPrototypeOf(s,Ve.prototype);else if(s.type==="root")Object.setPrototypeOf(s,Mt.prototype);if(s[Lt]=!0,s.nodes)for(let i of s.nodes)r.push(i)}}});var xe=e(function(kn,Tt){var Qe=N();class se extends Qe{constructor(t){super(t);this.type="atrule"}append(...t){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...t)}prepend(...t){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...t)}}Tt.exports=se;se.default=se;Qe.registerAtRule(se)});var be=e(function(In,$t){var Ns=N(),qt,Ut;class U extends Ns{constructor(t){super({type:"document",...t});if(!this.nodes)this.nodes=[]}toResult(t={}){return new qt(new Ut,this,t).stringify()}}U.registerLazyResult=(t)=>{qt=t};U.registerProcessor=(t)=>{Ut=t};$t.exports=U;U.default=U});var Dt=e(function(Bn,jt){var Ms="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",_s=(t,r=21)=>(s=r)=>{let i="",o=s|0;while(o-- >0)i+=t[Math.random()*t.length|0];return i},Ts=(t=21)=>{let r="",s=t|0;while(s-- >0)r+=Ms[Math.random()*64|0];return r};jt.exports={nanoid:Ts,customAlphabet:_s}});var Ye=e(function(Ln,Jt){var{existsSync:qs,readFileSync:Us,realpathSync:$s}=n("fs"),{dirname:ve,isAbsolute:js,join:Ds,relative:Fs,sep:Ws}=n("path"),{SourceMapConsumer:Ft,SourceMapGenerator:Wt}=Be();function zt(t){try{return $s(t)}catch{return t}}function zs(t){if(Buffer)return Buffer.from(t,"base64").toString();else return window.atob(t)}class Ce{constructor(t,r){if(r.map===!1)return;if(r.unsafeMap)this.unsafeMap=!0;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=r.map?r.map.prev:void 0,i=this.loadMap(r.from,s);if(!this.mapFile&&r.from)this.mapFile=r.from;if(this.mapFile)this.root=ve(this.mapFile);if(i)this.text=i}consumer(){if(!this.consumerCache)this.consumerCache=new Ft(this.json||this.text);return this.consumerCache}decodeInline(t){let r=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,l=t.match(i)||t.match(o);if(l)return decodeURIComponent(t.substr(l[0].length));let u=t.match(r)||t.match(s);if(u)return zs(t.substr(u[0].length));let a=t.slice(22);throw a=a.slice(0,a.indexOf(",")),Error("Unsupported source map encoding "+a)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){if(typeof t!=="object")return!1;return typeof t.mappings==="string"||typeof t._mappings==="string"||Array.isArray(t.sections)}loadAnnotation(t){let r=t.match(/\/\*\s*# sourceMappingURL=/g);if(!r)return;let s=t.lastIndexOf(r.pop()),i=t.indexOf("*/",s);if(s>-1&&i>-1)this.annotation=this.getAnnotationURL(t.substring(s,i))}loadFile(t,r,s){if(!s&&!this.unsafeMap){if(!/\.map$/i.test(t))return;if(!r)return;let i=Fs(zt(ve(r)),zt(t));if(i===".."||i.startsWith(".."+Ws)||js(i))return}if(this.root=ve(t),qs(t))return this.mapFile=t,Us(t,"utf-8").toString().trim()}loadMap(t,r){if(r===!1)return!1;if(r)if(typeof r==="string")return r;else if(typeof r==="function"){let s=r(t);if(s){let i=this.loadFile(s,t,!0);if(!i)throw Error("Unable to load previous source map: "+s.toString());return i}}else if(r instanceof Ft)return Wt.fromSourceMap(r).toString();else if(r instanceof Wt)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error("Unsupported previous source map format: "+r.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let s=this.annotation;if(t)s=Ds(ve(t),s);let i=this.loadFile(s,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return i}}startWith(t,r){if(!t)return!1;return t.substr(0,r.length)===r}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}Jt.exports=Ce;Ce.default=Ce});var oe=e(function(Nn,Qt){var{nanoid:Js}=Dt(),{isAbsolute:Ze,resolve:et}=n("path"),{SourceMapConsumer:Vs,SourceMapGenerator:Hs}=Be(),{fileURLToPath:Vt,pathToFileURL:Ee}=n("url"),Ht=ge(),Gs=Ye(),ie=De(),Xe=Symbol("lineToIndexCache"),Ks=Boolean(Vs&&Hs),Gt=Boolean(et&&Ze);function Kt(t){if(t[Xe])return t[Xe];let r=t.css.split(`
|
|
23
|
+
`),s=Array(r.length),i=0;for(let o=0,l=r.length;o<l;o++)s[o]=i,i+=r[o].length+1;return t[Xe]=s,s}class ne{get from(){return this.file||this.id}constructor(t,r={}){if(t===null||typeof t>"u"||typeof t==="object"&&!t.toString)throw Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(this.document=this.css,r.document)this.document=r.document.toString();if(r.from)if(!Gt||/^\w+:\/\//.test(r.from)||Ze(r.from))this.file=r.from;else this.file=et(r.from);if(Gt&&Ks){let s=new Gs(this.css,r);if(s.text){this.map=s;let i=s.consumer().file;if(!this.file&&i)this.file=this.mapResolve(i)}}if(!this.file)this.id="<input css "+Js(6)+">";if(this.map)this.map.file=this.from}error(t,r,s,i={}){let o,l,u,a,f;if(r&&typeof r==="object"){let m=r,c=s;if(typeof m.offset==="number"){a=m.offset;let d=this.fromOffset(a);r=d.line,s=d.col}else r=m.line,s=m.column,a=this.fromLineAndColumn(r,s);if(typeof c.offset==="number"){u=c.offset;let d=this.fromOffset(u);l=d.line,o=d.col}else l=c.line,o=c.column,u=this.fromLineAndColumn(c.line,c.column)}else if(!s){a=r;let m=this.fromOffset(a);r=m.line,s=m.col}else a=this.fromLineAndColumn(r,s);let h=this.origin(r,s,l,o);if(h)f=new Ht(t,h.endLine===void 0?h.line:{column:h.column,line:h.line},h.endLine===void 0?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,i.plugin);else f=new Ht(t,l===void 0?r:{column:s,line:r},l===void 0?s:{column:o,line:l},this.css,this.file,i.plugin);if(f.input={column:s,endColumn:o,endLine:l,endOffset:u,line:r,offset:a,source:this.css},this.file){if(Ee)f.input.url=Ee(this.file).toString();f.input.file=this.file}return f}fromLineAndColumn(t,r){return Kt(this)[t-1]+r-1}fromOffset(t){let r=Kt(this),s=r[r.length-1],i=0;if(t>=s)i=r.length-1;else{let o=r.length-2,l;while(i<o)if(l=i+(o-i>>1),t<r[l])o=l-1;else if(t>=r[l+1])i=l+1;else{i=l;break}}return{col:t-r[i]+1,line:i+1}}mapResolve(t){if(/^\w+:\/\//.test(t))return t;return et(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,r,s,i){if(!this.map)return!1;let o=this.map.consumer(),l=o.originalPositionFor({column:r-1,line:t});if(!l.source)return!1;let u;if(typeof s==="number"){let m=o.originalPositionFor({column:i-1,line:s});if(m.source)u=m}let a;if(Ze(l.source))a=Ee(l.source);else a=new URL(l.source,this.map.consumer().sourceRoot||Ee(this.map.mapFile));let f={column:l.column+1,endColumn:u&&u.column+1,endLine:u&&u.line,line:l.line,url:a.toString()};if(a.protocol==="file:")if(Vt)f.file=Vt(a);else throw Error("file: protocol is not available in this PostCSS build");let h=o.sourceContentFor(l.source);if(h)f.source=h;return f}toJSON(){let t={};for(let r of["hasBOM","css","file","id"])if(this[r]!=null)t[r]=this[r];if(this.map){if(t.map={...this.map},t.map.consumerCache)t.map.consumerCache=void 0}return t}}Qt.exports=ne;ne.default=ne;if(ie&&ie.registerInput)ie.registerInput(ne)});var D=e(function(Mn,Zt){var tt=N(),Yt,Xt;class T extends tt{constructor(t){super(t);if(this.type="root",!this.nodes)this.nodes=[]}normalize(t,r,s){let i=new Set;for(let l of Array.isArray(t)?t:[t])if(l&&typeof l==="object"&&!l.parent&&l.raws&&typeof l.raws.before<"u")i.add(l.raws);let o=super.normalize(t);if(r){if(s==="prepend")if(this.nodes.length>1)r.raws.before=this.nodes[1].raws.before;else delete r.raws.before;else if(this.first!==r){for(let l of o)if(!i.has(l.raws))l.raws.before=r.raws.before}}return o}removeChild(t,r){let s=this.index(t);if(!r&&s===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[s].raws.before;return super.removeChild(t)}toResult(t={}){return new Yt(new Xt,this,t).stringify()}}T.registerLazyResult=(t)=>{Yt=t};T.registerProcessor=(t)=>{Xt=t};Zt.exports=T;T.default=T;tt.registerRoot(T)});var st=e(function(_n,er){var le={comma(t){return le.split(t,[","],!0)},space(t){let r=[" ",`
|
|
24
|
+
`,"\t"];return le.split(t,r)},split(t,r,s){if(typeof t!=="string")return[];let i=[],o="",l=!1,u=0,a=!1,f="",h=!1;for(let c of t){if(h)h=!1;else if(c==="\\")h=!0;else if(a){if(c===f)a=!1}else if(c==='"'||c==="'")a=!0,f=c;else if(c==="(")u+=1;else if(c===")"){if(u>0)u-=1}else if(u===0){if(r.includes(c))l=!0}if(l){let d=o.trim();if(s||d!=="")i.push(d);o="",l=!1}else o+=c}let m=o.trim();if(s||m!=="")i.push(m);return i}};er.exports=le;le.default=le});var Ae=e(function(Tn,rr){var it=N(),tr=st();class ae extends it{get selectors(){return tr.comma(this.selector)}set selectors(t){let r=this.selector?this.selector.match(/,\s*/):null,s=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t);if(this.type="rule",!this.nodes)this.nodes=[]}}rr.exports=ae;ae.default=ae;it.registerRule(ae)});var lr=e(function(qn,or){var Qs=xe(),Ys=te(),Xs=re(),ir=oe(),nr=Ye(),Zs=D(),ei=Ae();function sr(t,r){if(!t.inputs)return r;return t.inputs.map((s)=>{let i={...s,__proto__:ir.prototype};if(i.map)i.map={...i.map,__proto__:nr.prototype};return i})}function ti(t,r,s){let i={...t};if(delete i.inputs,delete i.nodes,i.source){let{inputId:l,...u}=i.source;if(i.source=u,l!=null)i.source.input=r[l]}let o;if(i.type==="root")o=new Zs(i);else if(i.type==="decl")o=new Xs(i);else if(i.type==="rule")o=new ei(i);else if(i.type==="comment")o=new Ys(i);else if(i.type==="atrule")o=new Qs(i);else throw Error("Unknown node type: "+t.type);if(s){o.nodes=s;for(let l of s)l.parent=o}return o}function Pe(t,r){if(Array.isArray(t))return t.map((o)=>Pe(o));let s,i=[{childIndex:0,children:[],inputs:sr(t,r),json:t}];while(i.length>0){let o=i[i.length-1],l=o.json.nodes;if(l&&o.childIndex<l.length){let a=l[o.childIndex];o.childIndex+=1,i.push({childIndex:0,children:[],inputs:sr(a,o.inputs),json:a});continue}i.pop();let u=ti(o.json,o.inputs,l?o.children:void 0);if(i.length>0)i[i.length-1].children.push(u);else s=u}return s}or.exports=Pe;Pe.default=Pe});var ot=e(function(Un,mr){var{dirname:Re,relative:ur,resolve:cr,sep:hr}=n("path"),{SourceMapConsumer:pr,SourceMapGenerator:ke}=Be(),{pathToFileURL:ar}=n("url"),ri=oe(),si=Boolean(pr&&ke),ii=Boolean(Re&&cr&&ur&&hr);class dr{constructor(t,r,s,i){this.stringify=t,this.mapOpts=s.map||{},this.root=r,this.opts=s,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;if(this.isInline())t="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")t=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")t=this.mapOpts.annotation(this.opts.to,this.root);else t=this.outputFile()+".map";let r=`
|
|
25
|
+
`;if(this.css.includes(`\r
|
|
26
|
+
`))r=`\r
|
|
27
|
+
`;this.css+=r+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),s=t.root||Re(t.file),i;if(this.mapOpts.sourcesContent===!1){if(i=new pr(t.text),i.sourcesContent)i.sourcesContent=null}else i=t.consumer();this.map.applySourceMap(i,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let t;for(let r=this.root.nodes.length-1;r>=0;r--){if(t=this.root.nodes[r],t.type!=="comment")continue;if(t.text.startsWith("# sourceMappingURL="))this.root.removeChild(r)}}else if(this.css){let t="/*# sourceMappingURL=",r;while((r=this.css.lastIndexOf(t))!==-1){let s=this.css.indexOf("*/",r+t.length);if(s===-1)break;while(r>0&&this.css[r-1]===`
|
|
28
|
+
`)r--;this.css=this.css.slice(0,r)+this.css.slice(s+2)}}}generate(){if(this.clearAnnotation(),ii&&si&&this.isMap())return this.generateMap();else{let t="";return this.stringify(this.root,(r)=>{t+=r}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=ke.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ke({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new ke({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,r=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,l;this.stringify(this.root,(u,a,f)=>{if(this.css+=u,a&&f!=="end")if(i.generated.line=t,i.generated.column=r-1,a.source&&a.source.start)i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i);else i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i);if(l=u.match(/\n/g),l)t+=l.length,o=u.lastIndexOf(`
|
|
29
|
+
`),r=u.length-o;else r+=u.length;if(a&&f!=="start"){let h=a.parent||{raws:{}};if(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==h.last||h.raws.semicolon)if(a.source&&a.source.end)i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=t,i.generated.column=r-2,this.map.addMapping(i);else i.source=s,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=r-1,this.map.addMapping(i)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation<"u")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((t)=>t.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;if(typeof t<"u"&&t!==!0)return!1;if(this.previous().length)return this.previous().some((r)=>r.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((t)=>t.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(t){if(this.mapOpts.absolute)return t;if(t.charCodeAt(0)===60)return t;if(/^\w+:\/\//.test(t))return t;let r=this.memoizedPaths.get(t);if(r)return r;let s=this.opts.to?Re(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")s=Re(cr(s,this.mapOpts.annotation));let i=ur(s,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((t)=>{if(t.source&&t.source.input.map){let r=t.source.input.map;if(!this.previousMaps.includes(r))this.previousMaps.push(r)}});else{let t=new ri(this.originalCSS,this.opts);if(t.map)this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk((r)=>{if(r.source){let s=r.source.input.from;if(s&&!t[s]){t[s]=!0;let i=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(i,r.source.input.css)}}});else if(this.css){let r=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(r,this.css)}}sourcePath(t){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(t.source.input.from);else return this.toUrl(this.path(t.source.input.from))}toBase64(t){if(Buffer)return Buffer.from(t).toString("base64");else return window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let r=this.memoizedFileURLs.get(t);if(r)return r;if(ar){let s=ar(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let r=this.memoizedURLs.get(t);if(r)return r;if(hr==="\\")t=t.replace(/\\/g,"/");let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}}mr.exports=dr});var Sr=e(function($n,xr){var ni=xe(),oi=te(),li=re(),ai=D(),gr=Ae(),ui=je(),yr={empty:!0,space:!0};function fi(t){for(let r=t.length-1;r>=0;r--){let s=t[r],i=s[3]||s[2];if(i)return i}}function lt(t,r,s){let i="";for(let o=r;o<s;o++)i+=t[o][1];return i}class wr{constructor(t){this.input=t,this.root=new ai,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let r=new ni;if(r.name=t[1].slice(1),r.name==="")this.unnamedAtrule(r,t);this.init(r,t[2]);let s,i,o,l=!1,u=!1,a=[],f=[];while(!this.tokenizer.endOfFile()){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="[")f.push(s==="("?")":"]");else if(s==="{"&&f.length>0)f.push("}");else if(s===f[f.length-1])f.pop();if(f.length===0)if(s===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){u=!0;break}else if(s==="}"){if(a.length>0){o=a.length-1,i=a[o];while(i&&i[0]==="space")i=a[--o];if(i)r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++}this.end(t);break}else a.push(t);else a.push(t);if(this.tokenizer.endOfFile()){l=!0;break}}if(r.raws.between=this.spacesAndCommentsFromEnd(a),a.length){if(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),l)t=a[a.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between=""}else r.raws.afterName="",r.params="";if(u)r.nodes=[],this.current=r}checkMissedSemicolon(t){let r=this.colon(t);if(r===!1)return;let s=0,i;for(let o=r-1;o>=0;o--)if(i=t[o],i[0]!=="space"){if(s+=1,s===2)break}throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let r=0,s,i,o;for(let[l,u]of t.entries()){if(i=u,o=i[0],o==="(")r+=1;if(o===")")r-=1;if(r===0&&o===":")if(!s)this.doubleColon(i);else if(s[0]==="word"&&s[1]==="progid")continue;else return l;s=i}return!1}comment(t){let r=new oi;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;let s=t[1].slice(2,-2);if(!s.trim())r.text="",r.raws.left=s,r.raws.right="";else{let i=s.match(/^(\s*)([^]*\S)(\s*)$/);r.text=i[2],r.raws.left=i[1],r.raws.right=i[3]}}createTokenizer(){this.tokenizer=ui(this.input)}decl(t,r){let s=new li;this.init(s,t[0][2]);let i=t[t.length-1];if(i[0]===";")this.semicolon=!0,t.pop();s.source.end=this.getPosition(i[3]||i[2]||fi(t)),s.source.end.offset++;let o=0;while(t[o][0]!=="word"){if(o===t.length-1)this.unknownWord([t[o]]);o++}s.raws.before+=lt(t,0,o),s.source.start=this.getPosition(t[o][2]);let l=o;while(o<t.length){let c=t[o][0];if(c===":"||c==="space"||c==="comment")break;o++}s.prop=lt(t,l,o);let u=o,a;while(o<t.length){if(a=t[o],o++,a[0]===":")break;if(a[0]==="word"&&/\w/.test(a[1]))this.unknownWord([a])}if(s.raws.between=lt(t,u,o),s.prop[0]==="_"||s.prop[0]==="*")s.raws.before+=s.prop[0],s.prop=s.prop.slice(1);let f=o;while(o<t.length){let c=t[o][0];if(c!=="space"&&c!=="comment")break;o++}let h=t.slice(f,o);t=t.slice(o),this.precheckMissedSemicolon(t);for(let c=t.length-1;c>=0;c--){if(a=t[c],a[1].toLowerCase()==="!important"){s.important=!0;let d=this.stringFrom(t,c);if(d=this.spacesFromEnd(t)+d,d!==" !important")s.raws.important=d;break}else if(a[1].toLowerCase()==="important"){let d=t.slice(0),y="";for(let b=c;b>0;b--){let E=d[b][0];if(y.trim().startsWith("!")&&E!=="space")break;y=d.pop()[1]+y}if(y.trim().startsWith("!"))s.important=!0,s.raws.important=y,t=d}if(a[0]!=="space"&&a[0]!=="comment")break}if(t.some((c)=>c[0]!=="space"&&c[0]!=="comment"))s.raws.between+=h.map((c)=>c[1]).join(""),h=[];if(this.raw(s,"value",h.concat(t),r),s.value.includes(":")&&!r)this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let r=new gr;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r}end(t){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(t)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let r=this.current.nodes[this.current.nodes.length-1];if(r&&r.type==="rule"&&!r.raws.ownSemicolon)r.raws.ownSemicolon=this.spaces,this.spaces="",r.source.end=this.getPosition(t[2]),r.source.end.offset++}}getPosition(t){let r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}}init(t,r){if(this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment")this.semicolon=!1}other(t){let r=!1,s=null,i=!1,o=null,l=[],u=t[1].startsWith("--"),a=[],f=t;while(f){if(s=f[0],a.push(f),s==="("||s==="["){if(!o)o=f;l.push(s==="("?")":"]")}else if(u&&i&&s==="{"){if(!o)o=f;l.push("}")}else if(l.length===0){if(s===";")if(i){this.decl(a,u);return}else break;else if(s==="{"){this.rule(a);return}else if(s==="}"){this.tokenizer.back(a.pop()),r=!0;break}else if(s===":")i=!0}else if(s===l[l.length-1]){if(l.pop(),l.length===0)o=null}f=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())r=!0;if(l.length>0)this.unclosedBracket(o);if(r&&i){if(!u)while(a.length){if(f=a[a.length-1][0],f!=="space"&&f!=="comment")break;this.tokenizer.back(a.pop())}this.decl(a,u)}else this.unknownWord(a)}parse(){let t;while(!this.tokenizer.endOfFile())switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,r,s,i){let o,l,u=s.length,a="",f=!0,h,m;for(let c=0;c<u;c+=1)if(o=s[c],l=o[0],l==="space"&&c===u-1&&!i)f=!1;else if(l==="comment")if(m=s[c-1]?s[c-1][0]:"empty",h=s[c+1]?s[c+1][0]:"empty",!yr[m]&&!yr[h])if(a.slice(-1)===",")f=!1;else a+=o[1];else f=!1;else a+=o[1];if(!f){let c=s.reduce((d,y)=>d+y[1],"");t.raws[r]={raw:c,value:a}}t[r]=a}rule(t){t.pop();let r=new gr;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r}spacesAndCommentsFromEnd(t){let r,s="";while(t.length){if(r=t[t.length-1][0],r!=="space"&&r!=="comment")break;s=t.pop()[1]+s}return s}spacesAndCommentsFromStart(t){let r,s="";while(t.length){if(r=t[0][0],r!=="space"&&r!=="comment")break;s+=t.shift()[1]}return s}spacesFromEnd(t){let r,s="";while(t.length){if(r=t[t.length-1][0],r!=="space")break;s=t.pop()[1]+s}return s}stringFrom(t,r){let s="";for(let i=r;i<t.length;i++)s+=t[i][1];return t.splice(r,t.length-r),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})}}xr.exports=wr});var Le=e(function(jn,vr){var br=N(),ci=oe(),hi=Sr();function Ie(t,r){let s=new ci(t,r),i=new hi(s);try{i.parse()}catch(o){if(o.name==="CssSyntaxError"&&r&&r.from){if(/\.scss$/i.test(r.from))o.message+=`
|
|
30
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`;else if(/\.sass/i.test(r.from))o.message+=`
|
|
31
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`;else if(/\.less$/i.test(r.from))o.message+=`
|
|
32
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw o}return i.root}vr.exports=Ie;Ie.default=Ie;br.registerParse(Ie)});var at=e(function(Dn,Er){var Cr=N(),{my:pi}=X();class Ne{constructor(t,r={}){if(this.type="warning",this.text=t,r.node&&r.node.source){if(!r.node[pi])Cr.rebuild(r.node);let s=r.node.rangeBy(r);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in r)this[s]=r[s]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}Er.exports=Ne;Ne.default=Ne});var _e=e(function(Fn,Or){var di=at();class Me{get content(){return this.css}constructor(t,r,s){this.processor=t,this.messages=[],this.root=r,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,r={}){if(!r.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)r.plugin=this.lastPlugin.postcssPlugin}let s=new di(t,r);return this.messages.push(s),s}warnings(){return this.messages.filter((t)=>t.type==="warning")}}Or.exports=Me;Me.default=Me});var ut=e(function(Wn,Pr){var Ar={};Pr.exports=function(r){if(Ar[r])return;if(Ar[r]=!0,typeof console<"u"&&console.warn)console.warn(r)}});var ht=e(function(zn,Mr){var Br=N(),Lr=be(),mi=ot(),gi=Le(),Rr=_e(),Nr=D(),yi=Y(),{isClean:R,my:wi}=X(),xi=ut(),Si={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},bi={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},vi={Once:!0,postcssPlugin:!0,prepare:!0},F=0;function ue(t){return typeof t==="object"&&typeof t.then==="function"}function ft(t){let r=!1,s=Si[t.type];if(t.type==="decl")r=t.prop.toLowerCase();else if(t.type==="atrule")r=t.name.toLowerCase();if(r&&t.append)return[s,s+"-"+r,F,s+"Exit",s+"Exit-"+r];else if(r)return[s,s+"-"+r,s+"Exit",s+"Exit-"+r];else if(t.append)return[s,F,s+"Exit"];else return[s,s+"Exit"]}function kr(t){let r;if(t.type==="document")r=["Document",F,"DocumentExit"];else if(t.type==="root")r=["Root",F,"RootExit"];else r=ft(t);return{eventIndex:0,events:r,iterator:0,node:t,visitorIndex:0,visitors:[]}}function Ir(t){let r=[t];while(r.length>0){let s=r.pop();if(s[R]=!1,s.nodes)for(let i of s.nodes)r.push(i)}return t}var ct={};class _{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,r,s){this.stringified=!1,this.processed=!1;let i;if(typeof r==="object"&&r!==null&&(r.type==="root"||r.type==="document"))i=Ir(r);else if(r instanceof _||r instanceof Rr){if(i=Ir(r.root),r.map){if(typeof s.map>"u")s.map={};if(!s.map.inline)s.map.inline=!1;s.map.prev=r.map}}else{let o=gi;if(s.syntax)o=s.syntax.parse;if(s.parser)o=s.parser;if(o.parse)o=o.parse;try{i=o(r,s)}catch(l){this.processed=!0,this.error=l}if(i&&!i[wi])Br.rebuild(i)}this.result=new Rr(t,i,s),this.helpers={...ct,postcss:ct,result:this.result},this.plugins=this.processor.plugins.map((o)=>{if(typeof o==="object"&&o.prepare)return{...o,...o.prepare(this.result)};else return o})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(t,r){let s=this.result.lastPlugin;try{if(r)r.addToError(t);if(this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=s.postcssPlugin,t.setMessage();else if(s.postcssVersion){let{postcssPlugin:i,postcssVersion:o}=s,l=this.result.processor.version,u=o.split("."),a=l.split(".");if(u[0]!==a[0]||parseInt(u[1])>parseInt(a[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+l+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){if(console&&console.error)console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(r,s,i)=>{if(!this.listeners[s])this.listeners[s]=[];this.listeners[s].push([r,i])};for(let r of this.plugins)if(typeof r==="object")for(let s in r){if(!bi[s]&&/^[A-Z]/.test(s))throw Error(`Unknown event ${s} in ${r.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!vi[s]){if(typeof r[s]==="object")for(let i in r[s])if(i==="*")t(r,s,r[s][i]);else t(r,s+"-"+i.toLowerCase(),r[s][i]);else if(typeof r[s]==="function")t(r,s,r[s])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let r=this.plugins[t],s=this.runOnRoot(r);if(ue(s))try{await s}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;while(!t[R]){t[R]=!0;let r=[kr(t)];while(r.length>0){let s=this.visitTick(r);if(ue(s))try{await s}catch(i){let o=r[r.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[r,s]of this.listeners.OnceExit){this.result.lastPlugin=r;try{if(t.type==="document"){let i=t.nodes.map((o)=>s(o,this.helpers));await Promise.all(i)}else await s(t,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t==="object"&&t.Once){if(this.result.root.type==="document"){let r=this.result.root.nodes.map((s)=>t.Once(s,this.helpers));if(ue(r[0]))return Promise.all(r);return r}return t.Once(this.result.root,this.helpers)}else if(typeof t==="function")return t(this.result.root,this.result)}catch(r){throw this.handleError(r)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,r=yi;if(t.syntax)r=t.syntax.stringify;if(t.stringifier)r=t.stringifier;if(r.stringify)r=r.stringify;let s=this.result.root.source;if(t.map===void 0&&!(s&&s.input&&s.input.map)){let l="";return r(this.result.root,(u)=>{l+=u}),this.result.css=l,this.result}let o=new mi(r,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let r=this.runOnRoot(t);if(ue(r))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;while(!t[R])t[R]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,r){if(!("from"in this.opts))xi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(t,r)}toString(){return this.css}visitSync(t,r){for(let[s,i]of t){this.result.lastPlugin=s;let o;try{o=i(r,this.helpers)}catch(l){throw this.handleError(l,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(ue(o))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:s,visitors:i}=r;if(s.type!=="root"&&s.type!=="document"&&!s.parent){t.pop();return}if(i.length>0&&r.visitorIndex<i.length){let[l,u]=i[r.visitorIndex];if(r.visitorIndex+=1,r.visitorIndex===i.length)r.visitors=[],r.visitorIndex=0;this.result.lastPlugin=l;try{return u(s.toProxy(),this.helpers)}catch(a){throw this.handleError(a,s)}}if(r.iterator!==0){let l=r.iterator;if(r.descending)r.descending=!1,s.indexes[l]+=1;let u;while(u=s.nodes[s.indexes[l]]){if(!u[R]){u[R]=!0,r.descending=!0,t.push(kr(u));return}s.indexes[l]+=1}r.iterator=0,delete s.indexes[l]}let o=r.events;while(r.eventIndex<o.length){let l=o[r.eventIndex];if(r.eventIndex+=1,l===F){if(s.nodes&&s.nodes.length)s[R]=!0,r.iterator=s.getIterator();return}else if(this.listeners[l]){r.visitors=this.listeners[l];return}}t.pop()}walkSync(t){t[R]=!0;let r=[{eventIndex:0,events:ft(t),iterator:0,node:t}];while(r.length>0){let s=r[r.length-1],i=s.node;if(s.iterator!==0){let o=s.iterator;if(s.descending)s.descending=!1,i.indexes[o]+=1;let l,u=!1;while(l=i.nodes[i.indexes[o]]){if(!l[R]){l[R]=!0,s.descending=!0,r.push({eventIndex:0,events:ft(l),iterator:0,node:l}),u=!0;break}i.indexes[o]+=1}if(u)continue;s.iterator=0,delete i.indexes[o]}if(s.eventIndex<s.events.length){let o=s.events[s.eventIndex];if(s.eventIndex+=1,o===F){if(i.nodes&&i.nodes.length)s.iterator=i.getIterator()}else{let l=this.listeners[o];if(l){if(this.visitSync(l,i.toProxy()))r.pop()}}continue}r.pop()}}warnings(){return this.sync().warnings()}}_.registerPostcss=(t)=>{ct=t};Mr.exports=_;_.default=_;Nr.registerLazyResult(_);Lr.registerLazyResult(_)});var Tr=e(function(Jn,_r){var Ci=ot(),Ei=Le(),Oi=_e(),Ai=Y(),Pi=ut();class Te{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,r=Ei;try{t=r(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;else return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,r,s){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=s,this._map=void 0;let i=Ai;this.result=new Oi(this._processor,void 0,this._opts),this.result.css=r;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new Ci(i,void 0,this._opts,r);if(l.isMap()){let[u,a]=l.generate();if(u)this.result.css=u;if(a)this.result.map=a}else l.clearAnnotation(),this.result.css=l.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,r){if(!("from"in this._opts))Pi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(t,r)}toString(){return this._css}warnings(){return[]}}_r.exports=Te;Te.default=Te});var jr=e(function(Vn,$r){var qr=be(),Ri=ht(),ki=Tr(),Ur=D();class W{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let r=[];for(let s of t){if(s.postcss===!0)s=s();else if(s.postcss)s=s.postcss;if(typeof s==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if(typeof s==="object"&&s.postcssPlugin)r.push(s);else if(typeof s==="function")r.push(s);else if(typeof s==="object"&&(s.parse||s.stringify))throw Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw Error(s+" is not a PostCSS plugin")}return r}process(t,r={}){if(!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax)return new ki(this,t,r);else return new Ri(this,t,r)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}}$r.exports=W;W.default=W;Ur.registerProcessor(W);qr.registerProcessor(W)});var Kr=e(function(Hn,Gr){var Dr=xe(),Fr=te(),Ii=N(),Ni=ge(),Wr=re(),zr=be(),_i=lr(),Ti=oe(),Jr=ht(),qi=st(),Ui=ee(),$i=Le(),pt=jr(),ji=_e(),Vr=D(),Hr=Ae(),Di=Y(),Wi=at();function x(...t){if(t.length===1&&Array.isArray(t[0]))t=t[0];return new pt(t)}x.plugin=function(r,s){let i=!1;function o(...u){if(console&&console.warn&&!i){if(i=!0,console.warn(r+`: postcss.plugin was deprecated. Migration guide:
|
|
33
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh"))console.warn(r+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
34
|
+
`+"https://www.w3ctech.com/topic/2226")}let a=s(...u);return a.postcssPlugin=r,a.postcssVersion=new pt().version,a}let l;return Object.defineProperty(o,"postcss",{get(){if(!l)l=o();return l}}),o.process=function(u,a,f){return x([o(f)]).process(u,a)},o};x.stringify=Di;x.parse=$i;x.fromJSON=_i;x.list=qi;x.comment=(t)=>new Fr(t);x.atRule=(t)=>new Dr(t);x.decl=(t)=>new Wr(t);x.rule=(t)=>new Hr(t);x.root=(t)=>new Vr(t);x.document=(t)=>new zr(t);x.CssSyntaxError=Ni;x.Declaration=Wr;x.Container=Ii;x.Processor=pt;x.Document=zr;x.Comment=Fr;x.Warning=Wi;x.AtRule=Dr;x.Result=ji;x.Input=Ti;x.Rule=Hr;x.Root=Vr;x.Node=Ui;Jr.registerPostcss(x);Gr.exports=x;x.default=x});import{mkdir as mn,rm as gn}from"fs/promises";import{join as yn}from"path";import Qi from"bun-plugin-tailwind";import{realpathSync as Yi}from"fs";import{basename as qe,dirname as V,join as fe,relative as Xi,sep as ls}from"path";var S=g(Kr(),1),Qr=S.default,Gn=S.default.stringify,Kn=S.default.fromJSON,Qn=S.default.plugin,Yn=S.default.parse,Xn=S.default.list,Zn=S.default.document,eo=S.default.comment,to=S.default.atRule,ro=S.default.rule,so=S.default.decl,io=S.default.root,no=S.default.CssSyntaxError,oo=S.default.Declaration,lo=S.default.Container,ao=S.default.Processor,uo=S.default.Document,fo=S.default.Comment,co=S.default.Warning,ho=S.default.AtRule,po=S.default.Result,mo=S.default.Input,go=S.default.Rule,yo=S.default.Root,wo=S.default.Node;var zi=/^(:root|:host|html|body)(?![\w-])/;function Ji(t){return t?.type==="atrule"&&"name"in t&&typeof t.name==="string"&&/keyframes$/i.test(t.name)}function Yr(t,r){let s=`[data-applet=${JSON.stringify(r)}]`,i=Qr.parse(t);return i.walkRules((o)=>{if(Ji(o.parent))return;o.selectors=o.selectors.map((l)=>{let u=l.trim(),a=zi.exec(u);if(a)return s+u.slice(a[0].length);return`${s} ${u}`})}),i.toString()}var Xr=g(fr(),1);import{basename as Vi}from"path";var Hi=Se,Gi={rowSpan:1,colSpan:2},Ki=[1,2,3,4];function Zr(t,r=!1){let s=Xr.parse(t,{sourceType:"module",plugins:["typescript","jsx"],tokens:r}),o=(s.tokens??[]).filter((l)=>l.end===l.start+1&&t[l.start]===",").map((l)=>l.start);for(let l of s.program.body){if(l.type!=="ExportNamedDeclaration")continue;if(l.declaration?.type!=="VariableDeclaration")continue;let u=l.declaration.declarations.find((f)=>f.id.type==="Identifier"&&f.id.name==="config");if(!u)continue;let a=u.init;while(a?.type==="TSAsExpression"||a?.type==="TSSatisfiesExpression")a=a.expression;return{object:a?.type==="ObjectExpression"?a:null,commas:o}}return{object:void 0,commas:o}}function es(t){return Zr(t).object?.properties??null}function J(t){if(t.type==="SpreadElement")return null;if(t.key.type==="StringLiteral")return t.key.value;if(!t.computed&&t.key.type==="Identifier")return t.key.name;return null}function ts(t){if(t.type!=="ArrayExpression")return;let r=t.elements.filter((s)=>s?.type==="StringLiteral").map((s)=>s.value);return r.length?r:void 0}async function rs(t){let r=await Bun.file(t).text(),s=Vi(t).replace(/\.tsx?$/,""),i=es(r);if(!i)return null;let o={};for(let l of i){if(l.type!=="ObjectProperty")continue;let u=J(l);if(u==="requiredEnv"){let f=ts(l.value);if(f)o.requiredEnv=f;continue}if(u!=="rowSpan"&&u!=="colSpan")continue;if(l.value.type!=="NumericLiteral")continue;let a=l.value.value;if(!Ki.includes(a)){console.warn(`[mei] "${s}": config.${u}=${a} is out of 1\u20134 range, using default`);continue}o[u]=a}return{...Gi,...o}}async function ss(t){let r=await Bun.file(t).text(),s=es(r);if(!s)return null;let i={};for(let o of s){if(o.type!=="ObjectProperty")continue;let l=J(o);if(l==="title"){if(o.value.type==="StringLiteral")i.title=o.value.value;continue}if(l==="icon"){if(o.value.type==="StringLiteral"){let u=o.value.value;if(!rt(u))throw Error(`Unknown view icon id "${u}". Use one of: ${Hi.join(", ")}`);i.icon=u}continue}if(l==="requiredEnv"){let u=ts(o.value);if(u)i.requiredEnv=u}}return i}function z(t){let{start:r,end:s}=t;if(r===null||r===void 0||s===null||s===void 0)throw Error("Could not locate the view config in its source");return{start:r,end:s}}function Li(t,r){let{object:s,commas:i}=Zr(t,!0);if(s===null)throw Error("View config must be an exported object literal to rename this view");let o=JSON.stringify(r);if(s===void 0)return`export const config = { title: ${o} }
|
|
35
|
+
|
|
36
|
+
${t}`;let l=[...s.properties].reverse().find((C)=>C.type==="SpreadElement"||J(C)==="title"||C.computed&&J(C)===null);if(l&&J(l)==="title"){let C=l.type==="ObjectProperty"&&!l.shorthand,{start:I,end:M}=z(C?l.value:l);return t.slice(0,I)+(C?o:`title: ${o}`)+t.slice(M)}let u=[];for(let C=0;C<s.properties.length;C++){let I=s.properties[C];if(J(I)!=="title")continue;let M=z(I),Ue=z(s.properties[C+1]),G=i.find((L)=>L>=M.end&&L<Ue.start);if(G===void 0)throw Error("Could not locate the title separator");u.push({...M,text:""},{start:G,end:G+1,text:""})}let{start:a,end:f}=z(s),h=f-1,m=t.lastIndexOf(`
|
|
37
|
+
`,h-1)+1,c=t.slice(m,h),d=m>a&&/^[\t ]*$/.test(c),y=s.properties[0],b=y?z(y).start:a,E=t.slice(t.lastIndexOf(`
|
|
38
|
+
`,b-1)+1,b),p=/^[\t ]*$/.test(E)?E:c+" ",O=d?m:h,k=t.includes(`\r
|
|
39
|
+
`)?`\r
|
|
40
|
+
`:`
|
|
41
|
+
`;u.push({start:O,end:O,text:d?`${p}title: ${o},${k}`:` title: ${o} `});let H=s.properties.at(-1);if(H&&typeof s.extra?.trailingComma!=="number"){let{end:C}=z(H);u.push({start:C,end:C,text:","})}for(let C of u.sort((I,M)=>M.start-I.start))t=t.slice(0,C.start)+C.text+t.slice(C.end);return t}var Zi=/\.(png|jpe?g|gif|svg|webp|avif|ico|woff2?|ttf|otf)$/i,en=["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"],tn=on("rpc"),rn=on("moi"),sn=on("collab");function is(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function as(t){let r=await Bun.file(t).text(),s=new Bun.Transpiler({loader:"ts"}),{exports:i}=s.scan(r),o=i.filter((l)=>{let u=is(l);return!new RegExp(`export\\s+(type|interface)\\s+${u}\\b`).test(r)});for(let l of o){let u=is(l);if(!new RegExp(`export\\s+async\\s+function\\*?\\s+${u}\\b|export\\s+const\\s+${u}\\s*=\\s*async\\s*[\\(]`).test(r))throw Error(`"${l}" in ${qe(t)} is not an async function. .server.ts files can only export async functions.`)}return o}function ns(t){try{return Yi(t)}catch{return t}}function nn(t,r){let s=Xi(ns(r),ns(t)).replace(/\.server\.ts$/,"").split(ls).join("/");if(s===".."||s.startsWith("../"))throw Error(`Server file "${t}" escapes the Moi root "${r}"`);return s}function ln(t,r){let s=[],i=[];return{plugin:{name:"applet-runtime",setup(l){l.onResolve({filter:/^mei:rpc$/},()=>({path:tn})),l.onResolve({filter:/^devalue$/},()=>({path:Bun.resolveSync("devalue",import.meta.dir)})),l.onResolve({filter:/^moi\/collab$/},()=>({path:sn})),l.onResolve({filter:/^moi$/},()=>({path:rn})),l.onLoad({filter:Zi},async(u)=>{let a=new Uint8Array(await Bun.file(u.path).arrayBuffer()),f=Bun.hash(a).toString(16).slice(0,8),h=u.path.lastIndexOf("."),m=u.path.slice(h+1).toLowerCase(),d=`${qe(u.path.slice(0,h)).replace(/[^a-zA-Z0-9_-]/g,"-")}-${f}.${m}`;if(!i.some((y)=>y.name===d))i.push({name:d,data:a,kind:"asset"});return{contents:`export default new URL(${JSON.stringify("./"+d)}, import.meta.url).href`,loader:"js"}}),l.onResolve({filter:/\.server(\.ts)?$/},(u)=>{if(!u.path.startsWith("."))return;let a=u.importer&&u.importer.includes(ls)?V(u.importer):t;return{path:fe(a,u.path.replace(/\.server(\.ts)?$/,".server.ts")),namespace:"server-proxy"}}),l.onLoad({filter:/.*/,namespace:"server-proxy"},async(u)=>{let a=await as(u.path),f=nn(u.path,r);return s.push({name:f,exports:a}),{contents:['import { rpc } from "mei:rpc";',...a.map((m)=>`export const ${m} = rpc(${JSON.stringify(f)}, ${JSON.stringify(m)});`)].join(`
|
|
42
|
+
`),loader:"js"}})}},serverModules:s,assets:i}}var an=v("client","theme.css"),un=nt?[v("runtime","assets","tw-animate.css"),v("runtime","assets","shadcn.css")]:[fe(V(Bun.resolveSync("tw-animate-css/package.json",import.meta.dir)),"dist","tw-animate.css"),Bun.resolveSync("shadcn/tailwind.css",import.meta.dir)];async function fn(t,r,s){let i=V(t),o=fe(r,".build"),l=fe(o,`${s}-tailwind.css`),u=await Promise.all(un.map((f)=>Bun.file(f).text())),a=["@import 'tailwindcss';",await Bun.file(an).text(),...u,"@layer base { * { @apply border-border outline-ring/50; } }","@custom-variant dark (&:is(.dark *));","@custom-variant dark-or-vivid (&:is(.dark *, [data-vivid], [data-vivid] *));",`@source "${i}";`].join(`
|
|
43
|
+
`);return await Bun.write(l,a),l}function cn(t,r){return{name:"widget-entry",setup(s){s.onResolve({filter:/^__widget-entry$/},()=>({path:"__widget-entry",namespace:"widget-entry"})),s.onLoad({filter:/.*/,namespace:"widget-entry"},()=>({contents:[`import ${JSON.stringify(r)};`,`export { default } from ${JSON.stringify(t)};`,'export { __attachBridge, __getBridge } from "moi";'].join(`
|
|
44
|
+
`),loader:"js"}))}}}function hn(t,r){if(!r.trim())return t;return["(css => {",' const key = new URL(".", import.meta.url).pathname.replace(/\\/$/, "");'," (window.__moiAppletCss ||= new Map()).set(key, css);",`})(${JSON.stringify(r)});`].join(`
|
|
45
|
+
`)+`
|
|
46
|
+
`+t}function os(t){let r=t.level==="error"?"error":t.level,s=t.position?`${t.position.file}:${t.position.line}:${t.position.column}: `:"",i=t.position?.lineText?`
|
|
47
|
+
${t.position.lineText.trim()}`:"";return`${s}${r}: ${t.message}${i}`}function pn(t){let r=/from\s+['"](\.\.?\/[^'"]+?)\.server(?:\.ts)?['"]/g,s=[],i;while((i=r.exec(t))!==null)s.push(i[1]);return s}async function dn(t){let r=V(t),s=await Bun.file(t).text();for(let i of pn(s)){let o=fe(r,`${i}.server.ts`);if(await Bun.file(o).exists())await as(o)}}async function us(t,r=V(t),s="widget"){let i=V(t),o=qe(t).replace(/\.tsx?$/,"");await dn(t);let{plugin:l,serverModules:u,assets:a}=ln(i,r),f=await fn(t,r,s),h;try{h=await Bun.build({entrypoints:["__widget-entry"],format:"esm",target:"browser",sourcemap:"inline",external:en,define:{"process.env.NODE_ENV":JSON.stringify("production")},naming:{entry:"index.[ext]",chunk:"chunk-[hash].[ext]"},root:i,plugins:[cn(t,f),l,Qi]})}catch(p){let O=p.errors??[],k=O.length?O.map(os).join(`
|
|
48
|
+
`):p instanceof Error?p.message:String(p);throw Error(`Build failed for "${o}":
|
|
49
|
+
${k}`)}if(!h.success){let p=h.logs.map(os).join(`
|
|
50
|
+
`);throw Error(`Build failed for "${o}":
|
|
51
|
+
${p}`)}let m=h.outputs.find((p)=>p.kind==="entry-point"),c=h.outputs.filter((p)=>p.kind==="chunk"),d=h.outputs.find((p)=>p.kind==="asset"&&p.path.endsWith(".css"));if(!m)throw Error(`Build produced no JS output for "${o}"`);let y=await m.text();if(d){let p=s==="widget"?"widgets":"views",O=Yr(await d.text(),`${p}/${o}`);y=hn(y,O)}let b=[{name:"index.js",data:y,kind:"code"}];for(let p of c)b.push({name:qe(p.path),data:await p.text(),kind:"code"});b.push(...a);let E=s==="view"?await ss(t):await rs(t);return{js:y,files:b,serverModules:u,config:E}}var wn=he("applets/build-worker-entry.ts"),ce=new Set;function Mi(){for(let t of ce)t.kill();ce.clear()}async function xn(t){return Promise.all(t.jobs.map(async(r)=>{try{let s=await us(r.srcPath,t.moiRoot,t.kind);await gn(r.outDir,{recursive:!0,force:!0}),await mn(r.outDir,{recursive:!0});for(let i of s.files)await Bun.write(yn(r.outDir,i.name),i.data);return{name:r.name,status:"built",serverModules:s.serverModules.map((i)=>i.name),config:s.config}}catch(s){return{name:r.name,status:"failed",error:s instanceof Error?s.message:"Unknown error"}}}))}function Fi(t){if(t.jobs.length===0)return Promise.resolve([]);return new Promise((r)=>{let s=!1,i=(u)=>{if(s)return;s=!0,r(u)},o={type:"build",...t},l=Bun.spawn(j([process.execPath,wn]),{stdio:["ignore","inherit","inherit"],serialization:"json",ipc(u,a){let f=u;if(f.type!=="result"||!Array.isArray(f.results))return;i(f.results),ce.delete(a),a.kill()},onExit(u,a,f){ce.delete(u);let h=f?`signal ${f}`:`code ${a}`;i(t.jobs.map((m)=>({name:m.name,status:"failed",error:`Build worker exited (${h}) before reporting a result`})))}});ce.add(l),l.send(o)})}function Bi(){let t=process.ppid;process.on("disconnect",()=>process.exit(0)),setInterval(()=>{if(process.ppid!==t)process.exit(0)},500),process.on("message",async(r)=>{let s=r;if(s.type!=="build"||!Array.isArray(s.jobs))return;let o={type:"result",results:await xn(s)};process.send?.(o)})}
|
|
52
|
+
export{Li,Mi,Fi,Bi};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ji,Ot,kt,mr,hr,yr,Rt,gr,ke,Re,Tn,_r,Wi}from"./chunk-4wj1jzhr.js";function Nt(c,i,m){let k=U(!1,c,i,m);return typeof k==="string"?k:`[${k.join(",")}]`}function U(c,i,m,k){let r=_r(Wi,k?.operations),w=[],I=new Map,P=[];if(m)for(let e of Object.getOwnPropertyNames(m))P.push({key:e,fn:m[e]});let n=[],D=0;function f(e,y){let b=r.typeOf(e);if(b==="undefined")return Ot;let l;if(b==="number"){if(l=r.toPrimitive(e),Number.isNaN(l))return mr;if(l===1/0)return hr;if(l===-1/0)return yr;if(l===0&&1/l<0)return Rt}let A=r.identify(e);if(I.has(A))return I.get(A);y??=D++,I.set(A,y);for(let{key:p,fn:u}of P){let _=u(e);if(_)return w[y]=`["${p}",${f(_)}]`,y}if(b==="function")throw new ke("Cannot stringify a function",n,e,i);else if(b==="symbol")throw new ke("Cannot stringify a Symbol primitive",n,e,i);let t="";if(b!=="object")t=N(b==="number"?l:r.toPrimitive(e));else if(r.isThenable(e)){if(!c)throw new ke("Cannot stringify a Promise or thenable \u2014 use stringifyAsync instead",n,e,i);t=r.toPromise(e).then((p)=>{let u=f(p,y);if(u<0)w[y]=u})}else{let p=r.tagOf(e);switch(p){case"Number":case"String":case"Boolean":case"BigInt":t=`["Object",${f(r.unbox(e))}]`;break;case"Date":t=`["Date","${r.toISOString(e)}"]`;break;case"URL":t=`["URL",${Re(r.toStringValue(e))}]`;break;case"URLSearchParams":t=`["URLSearchParams",${Re(r.toStringValue(e))}]`;break;case"RegExp":let{source:u,flags:_}=r.regExpInfo(e);t=_?`["RegExp",${Re(u)},"${_}"]`:`["RegExp",${Re(u)}]`;break;case"Array":{let o=!1,a=r.lengthOf(e);t="[";for(let s=0;s<a;s+=1){if(s>0)t+=",";if(r.hasOwn(e,s))n.push(`[${s}]`),t+=f(r.get(e,s)),n.pop();else if(o)t+=kt;else{let g=r.indicesOf(e),d=g.length,E=String(a).length,B=(a-d)*3,L=4+E+d*(E+1);if(B>L){t="["+gr+","+a;for(let O=0;O<g.length;O++){let S=g[O];n.push(`[${S}]`),t+=","+S+","+f(r.get(e,S)),n.pop()}break}else o=!0,t+=kt}}t+="]";break}case"Set":t='["Set"';for(let o of r.valuesOf(e))t+=`,${f(o)}`;t+="]";break;case"Map":t='["Map"';for(let[o,a]of r.entriesOf(e)){let s=r.typeOf(o),g=s!=="object"&&s!=="function"&&s!=="symbol";n.push(`.get(${g?N(r.toPrimitive(o)):"..."})`),t+=`,${f(o)},${f(a)}`,n.pop()}t+="]";break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{let o=r.viewInfo(e);if(t='["'+p+'",'+f(o.buffer),o.byteLength!==o.bufferByteLength)t+=`,${o.byteOffset},${o.length}`;t+="]";break}case"DataView":{let o=r.viewInfo(e);if(t='["'+p+'",'+f(o.buffer),o.byteLength!==o.bufferByteLength)t+=`,${o.byteOffset},${o.byteLength}`;t+="]";break}case"ArrayBuffer":{t=`["ArrayBuffer","${ji(r.toArrayBuffer(e))}"]`;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":t=`["${p}",${Re(r.toStringValue(e))}]`;break;default:{let o=r.shapeOf(e);if(o.kind==="not-plain")throw new ke("Cannot stringify arbitrary non-POJOs",n,e,i);if(o.kind==="symbol-keys")throw new ke("Cannot stringify POJOs with symbolic keys",n,e,i);if(o.kind==="null-proto"){t='["null"';for(let a of o.keys){if(a==="__proto__")throw new ke("Cannot stringify objects with __proto__ keys",n,e,i);n.push(Tn(a)),t+=`,${Re(a)},${f(r.get(e,a))}`,n.pop()}t+="]"}else{t="{";let a=!1;for(let s of o.keys){if(s==="__proto__")throw new ke("Cannot stringify objects with __proto__ keys",n,e,i);if(a)t+=",";a=!0,n.push(Tn(s)),t+=`${Re(s)}:${f(r.get(e,s))}`,n.pop()}t+="}"}}}}return w[y]=t,y}let T=f(i);if(T<0)return`${T}`;return w}function N(c){let i=typeof c;if(i==="string")return Re(c);if(c===void 0)return Ot.toString();if(c===0&&1/c<0)return Rt.toString();if(i==="bigint")return`["BigInt","${c}"]`;return String(c)}
|
|
3
|
+
export{Nt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{readFileSync as P}from"fs";import{homedir as M}from"os";import{isAbsolute as w,join as O}from"path";import r from"path";import I from"os";import d from"process";var en=Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\x00bar"]);function D(n){if(typeof n!=="string")return!1;let e=n.trim();return e!==""&&e!=="."&&e!==".."&&!n.includes("/")&&!n.includes("\\")&&!n.includes("\x00")}function f(n){if(typeof n!=="string")throw TypeError("Expected a string");if(!D(n))throw Error(`Unsafe filename: ${JSON.stringify(n)}`)}var c=I.homedir(),l=I.tmpdir(),{env:a}=d,N=(n)=>{let e=r.join(c,"Library");return{data:r.join(e,"Application Support",n),config:r.join(e,"Preferences",n),cache:r.join(e,"Caches",n),log:r.join(e,"Logs",n),temp:r.join(l,n)}},R=(n)=>{let e=a.APPDATA||r.join(c,"AppData","Roaming"),o=a.LOCALAPPDATA||r.join(c,"AppData","Local");return{data:r.join(o,n,"Data"),config:r.join(e,n,"Config"),cache:r.join(o,n,"Cache"),log:r.join(o,n,"Log"),temp:r.join(l,n)}},T=(n)=>{let e=r.basename(c);return{data:r.join(a.XDG_DATA_HOME||r.join(c,".local","share"),n),config:r.join(a.XDG_CONFIG_HOME||r.join(c,".config"),n),cache:r.join(a.XDG_CACHE_HOME||r.join(c,".cache"),n),log:r.join(a.XDG_STATE_HOME||r.join(c,".local","state"),n),temp:r.join(l,e,n)}};function g(n,{suffix:e="nodejs"}={}){if(f(n),e)n+=`-${e}`;if(f(n),d.platform==="darwin")return N(n);if(d.platform==="win32")return R(n);return T(n)}import{accessSync as U,constants as m}from"fs";var x=process.env.MOI_DATA_DIR||g("moi",{suffix:""}).data;function vt(){try{return U(x,m.R_OK|m.W_OK|m.X_OK),!0}catch(n){return n.code==="ENOENT"}}var F={environment:"local",demo:!1,demoInstallUrl:"https://moi.computer",cloudflareAccess:null,workspacesDir:null,agentLauncher:null,unixSocket:null},z=O(x,"config.json");function s(n){console.error(`[moi] config: ${n}`)}function G(n){if(n===void 0)return;let e=n.trim().toLowerCase();if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;return}function E(n){if(n===void 0)return;if(n==="local"||n==="cloud")return n;s('ignoring environment \u2014 expected "local" or "cloud"');return}function A(n){if(n===void 0||n.trim()==="")return;return n.trim()}function _(n){let e=n.trim();if(!e)return;let o=/^[a-z0-9-]+$/i.test(e)?`${e}.cloudflareaccess.com`:e;try{let t=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(o)?o:`https://${o}`);if(t.protocol!=="https:"||t.pathname!=="/"||t.search||t.hash)return;if(t.username||t.password)return;return t.origin}catch{return}}function b(n){let e=typeof n==="string"?n.split(","):n;if(!Array.isArray(e)||!e.every((t)=>typeof t==="string"))return;let o=e.map((t)=>t.trim()).filter(Boolean);return o.length?o:void 0}function B(n){if(n===void 0||n===null)return{};if(typeof n!=="object"||Array.isArray(n))return s('ignoring "cloudflareAccess" \u2014 expected an object'),{};let{teamDomain:e,audience:o}=n,t={};if(e!==void 0){let i=typeof e==="string"?_(e):void 0;if(i)t.teamDomain=i;else s('ignoring "cloudflareAccess.teamDomain" \u2014 expected <team>.cloudflareaccess.com')}if(o!==void 0){let i=b(o);if(i)t.audience=i;else s('ignoring "cloudflareAccess.audience" \u2014 expected an AUD tag or an array of tags')}return t}function J(n){let e={},o=A(n.MOI_CLOUDFLARE_ACCESS_TEAM_DOMAIN);if(o!==void 0){let i=_(o);if(i)e.teamDomain=i;else s("ignoring MOI_CLOUDFLARE_ACCESS_TEAM_DOMAIN \u2014 expected <team>.cloudflareaccess.com")}let t=b(A(n.MOI_CLOUDFLARE_ACCESS_AUD));if(t)e.audience=t;return e}function K(n,e){let{teamDomain:o,audience:t}={...B(n),...J(e)};if(!o&&!t)return null;if(!o||!t)return s("ignoring Cloudflare Access \u2014 it needs both a team domain and an audience (AUD) tag"),null;return Object.freeze({teamDomain:o,audience:Object.freeze(t)})}function X(n){let e;try{e=P(n,"utf8")}catch(t){if(t.code!=="ENOENT")s(`could not read ${n}: ${t instanceof Error?t.message:String(t)}`);return{}}let o;try{o=JSON.parse(e)}catch(t){return s(`ignoring ${n} \u2014 invalid JSON: ${t instanceof Error?t.message:String(t)}`),{}}if(typeof o!=="object"||o===null||Array.isArray(o))return s(`ignoring ${n} \u2014 expected a JSON object`),{};return o}function V(n){let e={},o=E(n.environment);if(o!==void 0)e.environment=o;if(n.demo!==void 0)if(typeof n.demo==="boolean")e.demo=n.demo;else s('ignoring "demo" \u2014 expected a boolean');if(n.demoInstallUrl!==void 0)if(typeof n.demoInstallUrl==="string")e.demoInstallUrl=n.demoInstallUrl;else s('ignoring "demoInstallUrl" \u2014 expected a string');for(let t of["workspacesDir","agentLauncher","unixSocket"]){let i=n[t];if(i===void 0||i===null)continue;if(typeof i==="string"&&w(i))e[t]=i;else s(`ignoring "${t}" \u2014 expected an absolute path`)}return e}function S(n=z,e=process.env){let o=X(n),t=V(o),i={environment:E(e.MOI_ENVIRONMENT),demo:G(e.MOI_DEMO),demoInstallUrl:A(e.MOI_DEMO_INSTALL_URL)},u={...F,...t};for(let y of Object.keys(i))if(i[y]===void 0)delete i[y];let L=K(o.cloudflareAccess,e);return Object.freeze({...u,...i,cloudflareAccess:L})}var h=null;function Ls(){h=S()}function p(){return h??=S(),h}function Ce(){return p().workspacesDir??O(M(),"moi")}function Ms(){let{environment:n,demo:e,demoInstallUrl:o}=p();return{environment:n,demo:e,demoInstallUrl:o}}import{readFileSync as W}from"fs";import{join as k}from"path";var H=k(import.meta.dir,"..");function Y(){try{let n=JSON.parse(W(k(H,"package.json"),"utf8"));if(typeof n.version==="string")return n.version}catch{}return"0.0.0"}var C=Y();function tr(n){return n.includes("-")}function rr(){let n="";try{let e=Bun.spawnSync(["git","rev-parse","--short=8","HEAD"],{cwd:H});if(e.success)n=e.stdout.toString().trim()}catch{}return n?`${C} (${n})`:C}var Se=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],q=new Set(Se);function rt(n){return q.has(n)}import{spawn as Q}from"child_process";function j(n){let e=p().agentLauncher;return e?[e,...n]:[...n]}function $e(){let n=p().agentLauncher;if(!n)return;return({command:e,args:o,cwd:t,env:i,signal:u})=>Q(n,[e,...o],{cwd:t,env:i,signal:u,stdio:["pipe","pipe","inherit"]})}import{basename as Z,join as nn}from"path";var nt=!0;function v(...n){return nn(H,...n)}function he(n){return nt?v("runtime",Z(n,".ts")+".js"):v("server",n)}function on(n){return nt?v("runtime","applets",n+".js"):v("server","applets","runtime",n+".ts")}
|
|
3
|
+
export{x,vt,Ls,p,Ce,Ms,H,C,tr,rr,Se,rt,j,$e,nt,v,he,on};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var t=["pink","orange","amber","lime","emerald","cyan","blue","violet"];function c(n){return typeof n==="string"&&t.includes(n)}function Ui(n){let r=2166136261;for(let o=0;o<n.length;o++)r^=n.charCodeAt(o),r=Math.imul(r,16777619);return t[(r>>>0)%t.length]??t[0]}var En=1,zi=64,Vi=128,Ki=262144,f=4096,p=8192,a=320;function i(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function e(n,r=256){return typeof n==="string"&&n.length>0&&!n.includes("\x00")&&new TextEncoder().encode(n).length<=r}function s(n,r=0){if(r>24)return!1;if(n===null||typeof n==="string"||typeof n==="boolean")return!0;if(typeof n==="number")return Number.isFinite(n);if(Array.isArray(n))return n.every((o)=>s(o,r+1));if(!i(n))return!1;return Object.values(n).every((o)=>s(o,r+1))}function br(n){return i(n)&&e(n.id,240)&&n.id.trim().length>0&&(n.name===void 0||e(n.name)&&n.name.trim().length>0)&&c(n.color)&&(n.avatar===void 0||e(n.avatar,p))&&(n.email===void 0||e(n.email,a))}function l(n){return n===null||i(n)&&e(n.page,1024)&&(n.status==="active"||n.status==="away")}function Gi(n){if(!i(n))return!1;switch(n.type){case"join":return n.version===En&&br(n.profile)&&(n.location===void 0||l(n.location));case"profile":return br(n.profile);case"location":return l(n.location);case"presence:set":return e(n.registrationId)&&e(n.appletId)&&e(n.channel)&&s(n.value)&&new TextEncoder().encode(JSON.stringify(n.value)).length<=f;case"presence:delete":return e(n.registrationId);case"ping":return!0;default:return!1}}
|
|
3
|
+
export{Ui,En,zi,Vi,Ki,br,Gi};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ye,Ue,Pn,Hi,O,be,y,q,D,Me,bt}from"./chunk-c3qyet60.js";import{p,v}from"./chunk-kjp60rqs.js";import{join as st}from"path";import{cp as K,lstat as R,mkdir as pt,readFile as j,readdir as _,readlink as U}from"fs/promises";import{join as f}from"path";var z=v("skill");function w(t){if(t!=="moi-workspace")throw Error(`Unknown bundled skill: ${t}`);return z}async function L(){return["moi-workspace"]}var mt=f(z,"references","COLLAB.md");function V(t){return t!==mt||p().environment==="cloud"}async function E(t,r,e=!1){let i=await R(t),n=await R(r).catch(()=>null);if(!n)return!1;if(i.isDirectory()){if(!n.isDirectory())return!1;let s=(await _(t)).filter((a)=>V(f(t,a)));if(e&&(await _(r)).length!==s.length)return!1;return(await Promise.all(s.map((a)=>E(f(t,a),f(r,a),e)))).every(Boolean)}if(i.isFile()){if(!n.isFile()||i.size!==n.size)return!1;let[s,l]=await Promise.all([j(t),j(r)]);return s.equals(l)}if(i.isSymbolicLink()){if(!n.isSymbolicLink())return!1;let[s,l]=await Promise.all([U(t),U(r)]);return s===l}return!1}function X(t,r){return E(w(t),r,!0)}async function G(t){await pt(t,{recursive:!0});let r=[];for(let e of await L())if(await g(e,f(t,e)))r.push(e);return r}async function g(t,r){let e=w(t);if(await E(e,r))return!1;let i=f(e,"SKILL.md");return await K(e,r,{recursive:!0,force:!0,filter:(n)=>n!==i&&V(n)}),await K(i,f(r,"SKILL.md"),{force:!0}),!0}import{lstat as vt,realpath as Tt}from"fs/promises";import{basename as Nt,dirname as Bt,isAbsolute as Ft,join as P,relative as $t,resolve as it,sep as Ht}from"path";import{mkdir as H}from"fs/promises";import{join as et}from"path";function Ri(t){if(!t.trim())return"Workspace name is required";if(t.length>100)return"Workspace name is too long (max 100 characters)";return null}function cr(t){return t.normalize("NFKD").replace(/\p{M}/gu,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,60).replace(/^-|-$/g,"")||"workspace"}import{lstat as St,mkdir as Y,mkdtemp as ht,readlink as Pt,realpath as Z,rename as tt,rm as T,symlink as xt}from"fs/promises";import{dirname as u,join as m,relative as Lt,resolve as Et}from"path";import{realpath as ft}from"fs/promises";import{basename as kt,dirname as dt,join as gt,resolve as yt}from"path";var W=new Map;async function Q(t){try{return await ft(t)}catch(r){if(r.code!=="ENOENT")throw r;return gt(await Q(dt(t)),kt(t))}}async function h(t,r){let e=await Q(yt(t)),i=W.get(e)??{mutex:new be,users:0};W.set(e,i),i.users++;try{return await i.mutex.runExclusive(r)}finally{if(--i.users===0)W.delete(e)}}var S="moi-workspace";function k(t){return t===void 0||t==="claude-code"||t==="codex"}async function N(t){return St(t).catch((r)=>{if(r.code==="ENOENT")return;throw r})}async function rt(t){if((await N(t))?.isSymbolicLink())throw Error(`Cannot install workspace skill: ${t} is a symlink; use a real skills directory`)}async function ur(t,r){return h(B(t,r),()=>F(t,r))}function B(t,r){return k(r)?m(t,".agents","skills"):ye(t,r)}async function F(t,r){if(k(r))return Wt(t);let e=ye(t,r);return(await G(e)).map((i)=>m(e,i))}async function Wt(t){let r=Et(t),e=m(r,".agents","skills",S),i=m(r,".claude","skills",S);try{await rt(u(e)),await rt(u(i)),await Y(u(e),{recursive:!0}),await Y(u(i),{recursive:!0});let n=await Z(u(e))===await Z(u(i));if(!n&&(await N(m(r,".claude")))?.isSymbolicLink())throw Error("The .claude directory is a symlink; point it to .agents or use a real .claude directory");let s=Lt(u(i),e),l=await N(i),a=n||l?.isSymbolicLink()&&await Pt(i)===s,c=await X(S,e);if(c&&a)return[];let o=await ht(m(u(e),".moi-workspace-"));try{let d=m(o,S),I=m(o,"claude-link");if(!c)await g(S,d);if(!a)try{await xt(s,I,"dir")}catch(b){let M=b.code;if(process.platform==="win32"&&(M==="EPERM"||M==="EACCES"))throw Error("Windows could not create the workspace skill symlink; enable Developer Mode or run Moi as administrator, then retry",{cause:b});throw b}if(!c)await T(e,{recursive:!0,force:!0}),await tt(d,e);if(!a)await T(i,{recursive:!0,force:!0}),await tt(I,i)}finally{await T(o,{recursive:!0,force:!0})}return c?[i]:[e,i]}catch(n){throw Error(`Cannot reset workspace skill at ${e} and ${i}: ${String(n)}`,{cause:n})}}async function pr(t,r,e=q){let i=cr(t);await H(r,{recursive:!0});for(let n=1;;n++){let s=n===1?i:`${i}-${n}`;if(Ye(s)||await e(s))continue;let l=et(r,s);try{return await H(l),l}catch(a){if(a.code!=="EEXIST")throw a}}}function ye(t,r){return y(r).skillsDir?.(t)??et(t,".claude","skills")}async function J(t,r){let e=ye(t,r);await H(t,{recursive:!0});let i=await O(t);if(await ur(t,r),i.remote)return{skillsDir:e,scaffold:"skipped"};let n=Pn(),s=await Hi(t,void 0,void 0,n);if(s==="exists")return{skillsDir:e,scaffold:s};return{skillsDir:e,scaffold:s,installLogPath:n}}async function nt(t){let r=await vt(t).catch((e)=>{if(e.code==="ENOENT")return;throw e});if(!r){let e=await nt(Bt(t));return{...e,exists:!1,targetPath:P(e.targetPath,Nt(t))}}try{return{exists:!0,targetPath:await Tt(t)}}catch(e){if(r.isSymbolicLink()&&["ENOENT","ELOOP"].includes(e.code??""))return{exists:!0,targetPath:t,brokenLink:t};throw e}}async function x(t,r){let e=it(t),i=it(ye(e,r)),n=[...new Set([i,P(e,".claude","skills"),P(e,".agents","skills")])],s=[];for(let l of await L())for(let a of n){let c=P(a,l);try{let o=await nt(c);if(k(r)||a===i||o.exists||o.brokenLink)s.push({name:l,path:c,...o})}catch(o){throw Error(`Cannot inspect skill at ${c}: ${String(o)}`,{cause:o})}}return s}function It(t,r){let e=$t(t,r);return e===".."||e.startsWith(`..${Ht}`)||Ft(e)?r:e}var At=/<moi-skill\b[^>]*\bversion="([^"]+)"/;async function ot(t){let r=Bun.file(t);if(!await r.exists())return null;let e=(await r.text()).match(At);return e?e[1]:null}var C=Bun.semver;function at(t){try{return C.order(t,t),!0}catch{return!1}}function lt(t,r){if(!r||!at(r))return{behind:!1,minorBehind:!1};if(!t||!at(t))return{behind:!0,minorBehind:!0};let e=C.order(t,r)<0;return{behind:e,minorBehind:e&&!C.satisfies(r,`~${t}`)}}var Sn=(t,r)=>lt(t,r).minorBehind,Ct=(t,r)=>lt(t,r).behind;async function ct(t,r){return A(await x(t,r))}async function A(t){return Promise.all(t.map(async({name:r,path:e,brokenLink:i})=>({name:r,path:e,bundled:await ot(st(w(r),"SKILL.md")),installed:i?null:await ot(st(e,"SKILL.md"))})))}async function Ne(t){let r=Me(await D(),t);if(r)return{root:r.path,harness:r.harness};return{root:bt(t)}}async function dr(t){return(await Ne(t)).root}async function te(t){try{let{root:r,harness:e}=await Ne(t),i=(await ct(r,e)).filter((s)=>Sn(s.installed,s.bundled));if(i.length===0)return null;return`\u26A0 Moi skill outdated: ${i.map((s)=>`${It(r,s.path)} (${s.installed??"none"} \u2192 ${s.bundled})`).join(", ")} \u2014 run \`moi skill update\` to refresh.`}catch{return null}}import{basename as Mt}from"path";function ut(t){return{skills:t,updateAvailable:t.some((r)=>Ct(r.installed,r.bundled))}}async function wt(t,r){return ut(await ct(t,r))}async function Dt(t,r="claude-code"){return h(B(t,r),()=>Ot(t,r))}async function Ot(t,r){let e=await x(t,r),i=await A(e),n;if(k(r))n=await F(t,r);else{for(let o of e)if(o.brokenLink)throw Error(`Cannot update skill at ${o.path}: broken symlink ${o.brokenLink}`);let c=new Map;for(let o of e){if(c.has(o.targetPath))continue;try{c.set(o.targetPath,await g(o.name,o.targetPath))}catch(d){throw Error(`Cannot update skill at ${o.path}: ${String(d)}`,{cause:d})}}n=e.filter((o)=>c.get(o.targetPath)).map((o)=>o.path)}let s=[...new Set(n.map((c)=>Mt(c)))],l=await Ue(t),a=await ct(t,r);return{before:i,status:ut(a),changedSkills:s,changedSkillPaths:n,updatedAppletTypes:l}}
|
|
3
|
+
export{Ri,cr,ur,pr,ye,J,It,Sn,Ct,ct,Ne,dr,te,wt,Dt};
|