@kitn.ai/ui 0.27.0 → 0.28.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 +10 -2
- package/dist/{Icon-BnFKqqtY.js → Icon-DObhsRtm.js} +1 -1
- package/dist/{action-icons-CBskfBMz.js → action-icons-CcgNN2oT.js} +1 -1
- package/dist/arrow-down-CjRU3JgV.js +1 -0
- package/dist/arrow-left-Bnpb1UEW.js +1 -0
- package/dist/{artifact-CvXEm1lS.js → artifact-Bwt7OgcR.js} +1 -1
- package/dist/{attachments-C43ZegEq.js → attachments-Qr4kg-2b.js} +1 -1
- package/dist/{audio-visualizer-B-79y1Tj.js → audio-visualizer-DToYdfSc.js} +1 -1
- package/dist/{badge-BpUbq8c0.js → badge-CdEu_jn2.js} +1 -1
- package/dist/{bell-sn17Ip9v.js → bell-DQAAOpDz.js} +1 -1
- package/dist/{button-BH6rN0U-.js → button-DkuOnGLy.js} +1 -1
- package/dist/{card-renderer-Cb1gQmth.js → card-renderer-Jx70m6_l.js} +1 -1
- package/dist/{card-routing-DifQgS7n.js → card-routing-0YidER_3.js} +1 -1
- package/dist/check-njkVdZu2.js +1 -0
- package/dist/{checkbox-Dc9Yov_B.js → checkbox-D7iRB3nL.js} +1 -1
- package/dist/{checkbox-group-B1kDLLYk.js → checkbox-group-B2_rpoPM.js} +1 -1
- package/dist/chevron-down-B72s6PXR.js +1 -0
- package/dist/chevron-right-BatuHzUm.js +1 -0
- package/dist/{choice-card-BT3c1S8g.js → choice-card-m0BYqqOK.js} +1 -1
- package/dist/circle-check-B62pODB3.js +1 -0
- package/dist/{circle-x-wobWkoSx.js → circle-x-BPG0iPst.js} +1 -1
- package/dist/circle-zx0ByzY9.js +1 -0
- package/dist/code-block-ClMLKb7C.js +1 -0
- package/dist/{collapsible-CPJbf6FM.js → collapsible-B4DlWicL.js} +1 -1
- package/dist/components/chat-thread.d.ts +89 -1
- package/dist/components/conversation-item.d.ts +16 -0
- package/dist/components/conversation-panel.d.ts +29 -0
- package/dist/components/home-panel.d.ts +34 -0
- package/dist/components/widget-tab-bar.d.ts +16 -0
- package/dist/{composer-CjngLzal.js → composer-sQ0HcvyG.js} +3 -3
- package/dist/{confirm-card-DCx_A4bU.js → confirm-card-rQWDQsnC.js} +1 -1
- package/dist/construct-cli.es.js +182 -14
- package/dist/{context-BY8V-Nlp.js → context-0kg4ZX1J.js} +1 -1
- package/dist/controllable-CnGpMF6r.js +1 -0
- package/dist/conversation-item-BxwQLaFJ.js +1 -0
- package/dist/conversation-list-BCfGN1JU.js +1 -0
- package/dist/{copy-B6DO4PqB.js → copy-n9u9rqpi.js} +1 -1
- package/dist/{create-tween-CnMHviKB.js → create-tween-C-q-JCM-.js} +1 -1
- package/dist/{create-tween-D1aiGZZh.js → create-tween-CRrJXxBd.js} +1 -1
- package/dist/{create-tween-BPzaefTp.js → create-tween-DZ3RRDHD.js} +1 -1
- package/dist/{create-tween-DUSQUKpr.js → create-tween-uPkArjIG.js} +1 -1
- package/dist/custom-elements.json +51 -2
- package/dist/{default-input-CucQEOqH.js → default-input-CaMrJkgH.js} +1 -1
- package/dist/define-By-uL588.js +1 -0
- package/dist/define.js +2 -2
- package/dist/define.server.js +2 -2
- package/dist/{disclosure-CbLtajUQ.js → disclosure-WUImBbDv.js} +1 -1
- package/dist/{dropdown-BwhViJFd.js → dropdown-wZVeJOMd.js} +1 -1
- package/dist/elements/agent-card.js +1 -1
- package/dist/elements/artifact.js +1 -1
- package/dist/elements/attachments.js +1 -1
- package/dist/elements/audio-visualizer.js +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/badge.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/card.js +1 -1
- package/dist/elements/cards.js +1 -1
- package/dist/elements/chain-of-thought.js +1 -1
- package/dist/elements/chat-scope-picker.js +1 -1
- package/dist/elements/chat-workspace.js +1 -1
- package/dist/elements/chat.js +1 -1
- package/dist/elements/checkbox-group.js +1 -1
- package/dist/elements/checkbox.js +1 -1
- package/dist/elements/checkpoint.js +1 -1
- package/dist/elements/choice.js +1 -1
- package/dist/elements/coachmark.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command.js +1 -1
- package/dist/elements/compare.js +1 -1
- package/dist/elements/composer.js +1 -1
- package/dist/elements/confirm-card.js +1 -1
- package/dist/elements/context-meter.js +1 -1
- package/dist/elements/conversation-item.js +1 -1
- package/dist/elements/conversation-list.js +1 -1
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/dock.js +3 -3
- package/dist/elements/dropdown.js +1 -1
- package/dist/elements/editable-label.js +1 -1
- package/dist/elements/embed.js +1 -1
- package/dist/elements/empty.js +1 -1
- package/dist/elements/feedback-bar.js +1 -1
- package/dist/elements/file-tree.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/form.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/icon.js +1 -1
- package/dist/elements/image.js +1 -1
- package/dist/elements/input.js +1 -1
- package/dist/elements/kbd.js +1 -1
- package/dist/elements/link-preview.js +1 -1
- package/dist/elements/loader.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/menu.js +1 -1
- package/dist/elements/message-skills.js +1 -1
- package/dist/elements/message.js +1 -1
- package/dist/elements/model-switcher.js +1 -1
- package/dist/elements/nav.js +1 -1
- package/dist/elements/notice.js +1 -1
- package/dist/elements/pane-grid.js +1 -1
- package/dist/elements/pane-group.js +1 -1
- package/dist/elements/pane.js +1 -1
- package/dist/elements/popover.js +1 -1
- package/dist/elements/progress-bar.js +1 -1
- package/dist/elements/prompt-dock.js +1 -1
- package/dist/elements/prompt-input.js +1 -1
- package/dist/elements/prompt-suggestions.js +1 -1
- package/dist/elements/radio-group.js +1 -1
- package/dist/elements/reasoning.js +1 -1
- package/dist/elements/remote.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/response-stream.js +1 -1
- package/dist/elements/screen.js +1 -1
- package/dist/elements/scroll-area.js +1 -1
- package/dist/elements/scroll-button.js +1 -1
- package/dist/elements/search.js +1 -1
- package/dist/elements/segmented.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/separator.js +1 -1
- package/dist/elements/setting-item.js +1 -1
- package/dist/elements/settings-group.js +1 -1
- package/dist/elements/skeleton.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/source.js +1 -1
- package/dist/elements/status.js +1 -1
- package/dist/elements/switch.js +1 -1
- package/dist/elements/tabs.js +1 -1
- package/dist/elements/tasks.js +1 -1
- package/dist/elements/text-shimmer.js +1 -1
- package/dist/elements/thinking-bar.js +1 -1
- package/dist/elements/thread.js +1 -1
- package/dist/elements/toast.js +1 -1
- package/dist/elements/tool.js +1 -1
- package/dist/elements/tooltip.js +1 -1
- package/dist/elements/voice-input.js +1 -1
- package/dist/elements/voice-output.js +1 -1
- package/dist/elements.d.ts +20 -4
- package/dist/{ellipsis-DFr4Vqr3.js → ellipsis-CbOpJnU3.js} +1 -1
- package/dist/{embed-5s_vU4J0.js → embed-CrfjkbUG.js} +1 -1
- package/dist/{external-link-u9d85ORQ.js → external-link-ByXAwBBQ.js} +1 -1
- package/dist/{file-text-CX7_x42o.js → file-text-DMib2qwt.js} +1 -1
- package/dist/{file-tree-D3kBjXI5.js → file-tree-CJqM2aP7.js} +1 -1
- package/dist/{folder-V-YdIL8f.js → folder-_BAb929C.js} +1 -1
- package/dist/{form-BRNUMCN2.js → form-DSZgZQZk.js} +1 -1
- package/dist/{hover-card-DaeiYrTA.js → hover-card-BQbul9eq.js} +1 -1
- package/dist/{icon-BpixdZNq.js → icon-CdcfRhYI.js} +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2842 -2703
- package/dist/index.server.js +2820 -2681
- package/dist/{info-8mFsIjS3.js → info-DsFjGuI_.js} +1 -1
- package/dist/{input-d1Yuu-hz.js → input-DKbmkMos.js} +1 -1
- package/dist/kai.es.js +1 -1
- package/dist/{kbd-961zMPFB.js → kbd-PvdGhX4s.js} +1 -1
- package/dist/{link-preview-DIIbV2Sd.js → link-preview-DbM1866N.js} +1 -1
- package/dist/{link-DlZZBGaR.js → link-zF8PzWfF.js} +1 -1
- package/dist/{loader-YQszHFaW.js → loader-BM4CEz4G.js} +1 -1
- package/dist/{markdown-CVk1MPsj.js → markdown-LMvmAyBk.js} +7 -7
- package/dist/mcp.es.js +78 -4
- package/dist/{message-CwKVEdZg.js → message-BSsgvHvf.js} +1 -1
- package/dist/{message-DS8lzHc1.js → message-BYZECyek.js} +1 -1
- package/dist/message-circle-DruwObfX.js +1 -0
- package/dist/message-square-BG6q6mlm.js +1 -0
- package/dist/{minimize-2-UEZmP2QT.js → minimize-2-BQRoBV1V.js} +1 -1
- package/dist/{model-switcher-Kk1jEQ5t.js → model-switcher-CMpCOYcB.js} +1 -1
- package/dist/{overlay-C1od6LOz.js → overlay-Cb-MkyDa.js} +1 -1
- package/dist/{panel-right-ryET0yyn.js → panel-right-i8warFxT.js} +1 -1
- package/dist/{paperclip-BDNoZFJP.js → paperclip-ByY3UVO6.js} +1 -1
- package/dist/play-BvKKq3fX.js +1 -0
- package/dist/primitives/conversation-store.d.ts +54 -0
- package/dist/{progress-bar-BvYX0aoy.js → progress-bar-jVAHvMUf.js} +1 -1
- package/dist/{prompt-suggestion-BRFu2lcu.js → prompt-suggestion-CD-qtNgC.js} +1 -1
- package/dist/{radio-DcL23cNJ.js → radio-BsoBMhkF.js} +1 -1
- package/dist/react/index.d.ts +393 -0
- package/dist/react.js +20 -20
- package/dist/{reasoning-Cackq4Rh.js → reasoning-4kBPtlTx.js} +1 -1
- package/dist/register-impl-B1hLkrI8.js +424 -0
- package/dist/{resizable-Cp9HUYih.js → resizable-uPmY9VY-.js} +1 -1
- package/dist/{rotate-ccw-0DLRDHH5.js → rotate-ccw-B2xn93py.js} +1 -1
- package/dist/{rotate-cw-DOB9IGcU.js → rotate-cw-CMVLoCyH.js} +1 -1
- package/dist/{scroll-area-emVmWP4K.js → scroll-area-BqLUo8ZZ.js} +1 -1
- package/dist/{scroll-button-CeP_gv1x.js → scroll-button-DslXiJyL.js} +1 -1
- package/dist/{select-CWmu00tS.js → select-2cLRtPGT.js} +1 -1
- package/dist/{separator-CE6vly6z.js → separator-BWQtNJcM.js} +1 -1
- package/dist/{settings-CE-78SvZ.js → settings-BBR63jLg.js} +1 -1
- package/dist/{settings-group-ZFWNxFQR.js → settings-group-B2ciy-Iw.js} +1 -1
- package/dist/{skeleton-BebdP4mf.js → skeleton-CkHI-HgC.js} +1 -1
- package/dist/{slider-BAKRYUlz.js → slider-DDR9U-i0.js} +1 -1
- package/dist/{solid-BE5ui6sy.js → solid-BzCFdL25.js} +7720 -7058
- package/dist/{solid-DFhsce3O.js → solid-DruVOXnf.js} +5864 -5283
- package/dist/solid.d.ts +6 -2
- package/dist/solid.js +217 -210
- package/dist/solid.server.js +217 -210
- package/dist/{source-B0FlguSx.js → source-GEnFF528.js} +1 -1
- package/dist/{star-CBMZvLuN.js → star-CilHq8GP.js} +1 -1
- package/dist/store-Ciyk6eZG.js +1 -0
- package/dist/{switch-CViARZCy.js → switch-KkeQIbuH.js} +1 -1
- package/dist/{tasks-card-MjCcOhR_.js → tasks-card-BrN4bggJ.js} +1 -1
- package/dist/{text-shimmer-DKlwRF2G.js → text-shimmer-Dcj1MHuq.js} +1 -1
- package/dist/{textarea-3ay2Me2-.js → textarea-Dpvbngbg.js} +1 -1
- package/dist/theme.tokens.css +28 -0
- package/dist/{thumbs-up-DQcu2HMO.js → thumbs-up-CsT9Wzb9.js} +1 -1
- package/dist/{toast-store-C6yKOhbk.js → toast-store-tgK6MuMv.js} +1 -1
- package/dist/{tool-BCYNlfKy.js → tool-DzUjIBT8.js} +1 -1
- package/dist/{tooltip-05zI4hjs.js → tooltip-Bkkg_4t0.js} +1 -1
- package/dist/{trash-2-BR1RxGky.js → trash-2-jBKxjGGQ.js} +1 -1
- package/dist/{triangle-alert-DHohDOCy.js → triangle-alert-DlQ68ppf.js} +1 -1
- package/dist/types.d.ts +48 -3
- package/dist/ui/dock.d.ts +29 -0
- package/dist/{upload-BbGW6A_u.js → upload-TcAHXv9W.js} +1 -1
- package/dist/{url-scheme-policy-DHpoTJwB.js → url-scheme-policy-DR5DgvkM.js} +1 -1
- package/dist/{use-card-resolution-CJW4grFa.js → use-card-resolution-DaZqAdWf.js} +1 -1
- package/dist/{variant-aurora-xiMPty8f.js → variant-aurora-BhLuYxJR.js} +1 -1
- package/dist/{variant-aurora-BUOVgPOB.js → variant-aurora-CNmfHhcx.js} +2 -2
- package/dist/{variant-aurora-CUsUJvFI.js → variant-aurora-D6GsdTPA.js} +2 -2
- package/dist/{variant-aurora-CW2i4bfr.js → variant-aurora-DbW_OWL2.js} +1 -1
- package/dist/{variant-custom-D91HjAKz.js → variant-custom-BRvaNHSi.js} +1 -1
- package/dist/{variant-custom-BQtOnmeO.js → variant-custom-BvYHR62b.js} +1 -1
- package/dist/{variant-custom-CAnzzppW.js → variant-custom-DMTrEO5w.js} +2 -2
- package/dist/{variant-custom-CAm9L-E5.js → variant-custom-DV2x254s.js} +2 -2
- package/dist/{variant-wave-Ca1Ls4_y.js → variant-wave-BNMGrDfj.js} +2 -2
- package/dist/{variant-wave-uY5crU_K.js → variant-wave-BpDd8t3Z.js} +1 -1
- package/dist/{variant-wave-CxX39DKd.js → variant-wave-CyBueXj9.js} +2 -2
- package/dist/{variant-wave-DYyzIIZv.js → variant-wave-sp-qwsdI.js} +1 -1
- package/dist/x-Z5UntkIJ.js +1 -0
- package/frameworks/react/index.tsx +14 -4
- package/llms-full.txt +7 -2
- package/package.json +1 -1
- package/src/agent-tooling/README.md +192 -0
- package/src/agent-tooling/catalog/invariants.ts +2 -2
- package/src/agent-tooling/construct/cli.ts +16 -0
- package/src/agent-tooling/construct/codegen.ts +309 -27
- package/src/agent-tooling/construct/construct.v1.schema.json +69 -0
- package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +11 -2
- package/src/agent-tooling/construct/schema.ts +81 -0
- package/src/components/chat-thread.tsx +532 -36
- package/src/components/conversation-item.tsx +23 -0
- package/src/components/conversation-panel.tsx +118 -0
- package/src/components/home-panel.tsx +159 -0
- package/src/components/widget-tab-bar.tsx +73 -0
- package/src/elements/chat.tsx +94 -2
- package/src/elements/compiled.css +1 -1
- package/src/elements/element-meta.json +49 -6
- package/src/elements/element-nonscalar.json +2 -0
- package/src/elements/element-types.d.ts +20 -4
- package/src/index.ts +3 -1
- package/src/primitives/conversation-store.ts +248 -0
- package/src/solid.ts +10 -2
- package/src/types.ts +45 -3
- package/src/ui/dock.tsx +47 -1
- package/theme.css +28 -0
- package/dist/arrow-down-Br0qtpsz.js +0 -1
- package/dist/arrow-left-Dj7xgE12.js +0 -1
- package/dist/check-DPeeMUYx.js +0 -1
- package/dist/chevron-down-CHSWk7ZT.js +0 -1
- package/dist/chevron-right-B7l_fMgx.js +0 -1
- package/dist/circle-Bb0yOpqM.js +0 -1
- package/dist/circle-check-BGZpCiz7.js +0 -1
- package/dist/code-block-CUQ5mtv0.js +0 -1
- package/dist/controllable-D43BKmtX.js +0 -1
- package/dist/conversation-list-D4lLU_yS.js +0 -1
- package/dist/define-CGGX-7Vg.js +0 -1
- package/dist/message-circle-Xf8Q-vZp.js +0 -1
- package/dist/message-square-Cxnwgkns.js +0 -1
- package/dist/play-OFIvYXUQ.js +0 -1
- package/dist/register-impl-C7rENvPK.js +0 -424
- package/dist/store-7eoadydQ.js +0 -1
- package/dist/x-C5m1JFgi.js +0 -1
package/dist/mcp.es.js
CHANGED
|
@@ -806,9 +806,9 @@ const invariants = [
|
|
|
806
806
|
],
|
|
807
807
|
examples: [
|
|
808
808
|
{
|
|
809
|
-
wrong: "chat.
|
|
809
|
+
wrong: "chat.conversationRows = rows;",
|
|
810
810
|
right: "conversations.conversations = rows;",
|
|
811
|
-
note: "kai-chat has no
|
|
811
|
+
note: "kai-chat's own `conversations` prop is a boolean flag (turns the built-in list panel on); it has no `conversationRows`-shaped data prop, and the sidebar is its own element. One element never holds the whole app state."
|
|
812
812
|
},
|
|
813
813
|
{
|
|
814
814
|
wrong: "chat.addEventListener('kai-conversation-select', (e) => load(e.detail.id));",
|
|
@@ -8997,7 +8997,7 @@ const scaffold = {
|
|
|
8997
8997
|
);
|
|
8998
8998
|
}
|
|
8999
8999
|
};
|
|
9000
|
-
const themeCss = "/* @kitn.ai/ui design system — import after `@import \"tailwindcss\"`.\n Defines ONLY namespaced (--color-*) tokens, component keyframes, animation\n utilities, and the .chat-markdown styles. Contains NO global base/reset rules,\n so importing it restyles nothing on its own — a host opts in via the kit's\n components + classes. Rebrand by overriding the --color-* values (optionally\n scoped to a subtree).\n NOTE: This file is Tailwind-v4 source (requires tailwindcss as a peer). For\n bundler-based apps that don't use Tailwind, import @kitn.ai/ui/theme.tokens.css\n instead — it is plain compiled CSS with no toolchain requirements. */\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: var(--kai-color-background, hsl(0 0% 100%));\n --color-foreground: var(--kai-color-foreground, hsl(240 10% 3.9%));\n --color-card: var(--kai-color-card, hsl(0 0% 100%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(240 10% 3.9%));\n --color-popover: var(--kai-color-popover, hsl(0 0% 100%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(240 10% 3.9%));\n --color-primary: var(--kai-color-primary, hsl(240 5.9% 10%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(0 0% 98%));\n --color-secondary: var(--kai-color-secondary, hsl(240 4.8% 95.9%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(240 5.9% 10%));\n --color-muted: var(--kai-color-muted, hsl(240 4.8% 95.9%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(240 3.8% 43%));\n /* Subtle SURFACE — an opaque \"muted panel\" for things that sit OVER content\n (the prompt input, message bubbles, artifact/card headers, chips). CALCULATED\n from existing tokens — `--color-muted` blended 40% onto `--color-background`\n — so it tracks the theme (incl. dark) automatically and needs no hand-picked\n value. SOLID (no alpha), so nothing behind it bleeds through. This replaces\n ad-hoc `bg-muted/40` surfaces. Retint via the --kai-color-surface knob (or a\n bare value); --color-surface-strong is the stronger step (hover/raised) and\n --color-surface-sunken is recessed BELOW the base surface (wells, or a banner\n that sits behind a card). Sunken is theme-specific: \"darker than the card\"\n means a LOWER muted% in dark but a HIGHER one in light, so the two scopes\n can't share a number — see the .dark block. */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 85%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(240 4.8% 95.9%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(240 5.9% 10%));\n --color-destructive: var(--kai-color-destructive, hsl(0 72% 45%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - solid fills with a legible foreground, matched to\n the kit's tool-green / -amber / -blue hues so they read on-brand. Use\n bg-success / bg-warning / bg-info with the matching -foreground for badges,\n banners, and buttons; or text-success / -warning / -info on a soft tint\n (below). destructive (above) is the danger/error member of the same family.\n Light uses darker hues so the color carries a light foreground AND stays\n legible as text on a pale tint; dark (see .dark) flips to brighter hues over\n a near-black foreground. Override via --kai-color-success / -warning / -info\n (+ -foreground). */\n --color-success: var(--kai-color-success, hsl(142 71% 30%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(0 0% 98%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 30%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(0 0% 98%));\n --color-info: var(--kai-color-info, hsl(217 91% 42%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(0 0% 98%));\n /* Soft tinted status surfaces - OPAQUE, theme-tracking fills derived as ~14% of\n the status hue blended onto the background. Use these for subtle callouts /\n banners instead of an eyeballed bg-success/10; pair with text-success /\n -warning / -info / -destructive. Derived, so declared in BOTH light and dark\n (a color-mix resolves where it's declared - see the surface tokens above). A\n bare bg- utility for a color-mix token is added at the bottom (see bg-surface). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n /* Interaction-state backgrounds - opaque, theme-tracking fills for row/control\n states so consumers stop eyeballing /10 opacities. --color-hover is a subtle\n neutral (a little --color-muted on the background); --color-selected is a\n faint --color-primary tint so a selected row tracks the brand. Use bg-hover /\n bg-selected. Derived, so declared in BOTH light and dark; bare bg- utilities\n added at the bottom. */\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* MARKED text — the fill behind a keyword the app has flagged (the composer's\n `highlights` rules, decorated through the CSS Custom Highlight API). This is\n `<mark>`, not a selection and not a status: a warm yellow, the convention\n every browser already ships for <mark> and every reader already reads as\n \"someone marked this\". Deliberately NOT derived from --color-primary — that\n token is a NEUTRAL near-black in light and near-white in dark, so any tint of\n it is grey, which is why the highlight used to be invisible. Also not blue\n (the browser's own ::selection is blue — a highlight must not read as a\n selection), not red (error) and not the skill/agent pill hues (blue/violet).\n OPAQUE, so it composites predictably over whichever field it lands on.\n Override via --kai-color-highlight. Light: near-black text over it is 15.6:1;\n dark: near-white text over it is 6.7:1 — both well clear of WCAG AA. */\n --color-highlight: var(--kai-color-highlight, hsl(45 96% 78%));\n /* SELECTED text — the kit's own ::selection fill, applied inside every kai-*\n shadow root (see src/elements/styles.css for the scoping rationale). The kit\n owns this because leaving it to the UA meant the browser's blue outranked the\n kit's own deliberate emphasis: a marked keyword was LESS prominent than an\n incidental drag-select. Stays in the cool/blue family the UA trained everyone\n to read as \"selected\", so it can never be confused with the warm --color-highlight\n mark above; OPAQUE, so a selection over a mark composites cleanly (selection\n paints on top of a custom highlight) instead of muddying into a third colour.\n The FOREGROUND is set too, and that is not cosmetic: without it the selected\n glyph keeps its own colour, and the kit's coloured text — muted text (3.8:1),\n the skill/agent pill hues (3.6:1 / 4.0:1), inline code (4.7:1) — lands at or\n under WCAG AA on this fill. Forcing the foreground token makes the guarantee\n hold for every glyph regardless of what colour it had. Light 13.99:1,\n dark 8.87:1. Override via --kai-color-selection(-foreground). */\n --color-selection: var(--kai-color-selection, hsl(213 94% 87%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(240 10% 3.9%));\n --color-border: var(--kai-color-border, hsl(240 5.9% 90%));\n /* CONTROL boundary — the visible edge of an interactive form control (text\n input, textarea, select, the radio/checkbox ring). WCAG 2.1 SC 1.4.11\n Non-text Contrast requires >=3:1 against the adjacent surface for exactly\n this: a control whose boundary you cannot see is not perceivable. That is\n why this is NOT --color-border: a divider or a card outline is decorative\n and may sit below 3:1, a control's edge may not. Do NOT use border-input\n for list wrappers or panel outlines — use border-border there.\n Contrast is the requirement; a thicker border does not satisfy 1.4.11. */\n --color-input: var(--kai-color-input, hsl(240 5% 53%));\n /* Focus ring — a deliberate blue (not a neutral) so keyboard focus is always\n obvious and on-brand in both modes. Light uses a strong blue; dark uses a\n brighter one for contrast on dark surfaces. Both clear WCAG 2.1 non-text\n contrast (≥3:1) against the kit's backgrounds. Override via --kai-color-ring. */\n --color-ring: var(--kai-color-ring, hsl(217 91% 53%));\n /* Custom scrollbars — thin, rounded, subtle; thumb strengthens on hover. A\n consistent cross-platform look (the kit styles its OWN scroll regions inside\n the shadow root; the track stays transparent so nothing is forced where no\n scrollbar is needed). Override via --kai-color-scrollbar-thumb(-hover). */\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(240 5% 80%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(240 4% 64%));\n --color-sidebar: var(--kai-color-sidebar, hsl(0 0% 100%));\n\n /* Inline `code` accent. Blue text on a translucent blue chip. */\n --color-code-foreground: var(--kai-color-code-foreground, hsl(224.3 76.3% 48%));\n\n /* Tool/status chip hues. Each chip is hue text over a 15% translucent fill of\n the SAME hue (set in tool.tsx). The bare hue is too light to reach WCAG AA\n (4.5:1) on the faint fill in LIGHT mode, so the light values are darkened;\n dark mode keeps brighter hues for AA on the dark fill. Override via\n --kai-color-tool-* to retheme. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 38%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 28%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 26%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 72% 42%));\n\n --radius: var(--kai-radius, 0.6rem);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n /* Typography scale — ONE scale for the whole kit. Each semantic name\n (text-micro / text-caption / text-meta / text-compact / text-body /\n text-title / text-lg)\n resolves through a namespaced --kai-text-* token, so overriding that token\n on :root restyles the kit globally — it pierces the Shadow DOM via the\n var() fallback, exactly like the --kai-color-* tokens. The bare --text-*\n names stay internal so a host's own --text-* can't collide.\n\n Tailwind's OWN scale is re-pointed at the same tokens: in Tailwind v4 the\n `text-xs` / `text-sm` / `text-base` / `text-lg` utilities are generated FROM\n --text-xs/sm/base/lg in this very @theme block, so aliasing them makes\n text-xs ≡ text-meta, text-sm ≡ text-body, text-base ≡ text-title and\n text-lg ≡ text-lg. That matters because the vast majority of the kit's call\n sites spell the Tailwind name; without the alias the --kai-text-* knobs\n reached ~12% of them and the \"globally\" promise in the theming guide was\n false. Defaults are byte-identical to stock Tailwind, so nothing moves\n until a consumer actually sets a --kai-text-* token — including in a\n consumer's own Tailwind build that imports this file, which is the point:\n one scale everywhere, kit and app moving together.\n\n Line-heights are UNITLESS RATIOS (Tailwind's own), never fixed rem. A fixed\n leading does not scale: --kai-text-body: 1.25rem under the old 1.45rem\n leading gave 20px text on 23.2px leading — near solid-set — which made the\n themable token unsafe to actually theme.\n (Message/markdown reading size also scales with the `proseSize` prop; these\n tokens cover the fixed chrome & controls.) */\n --text-micro: var(--kai-text-micro, 0.625rem); --text-micro--line-height: calc(0.875 / 0.625); /* 10px — badges, pills, uppercase eyebrows */\n --text-caption: var(--kai-text-caption, 0.6875rem); --text-caption--line-height: calc(1 / 0.6875); /* 11px — micro labels, sub-counts, xs code */\n --text-meta: var(--kai-text-meta, 0.75rem); --text-meta--line-height: calc(1 / 0.75); /* 12px — controls, toggles, switchers, captions */\n --text-xs: var(--kai-text-meta, 0.75rem); --text-xs--line-height: calc(1 / 0.75); /* ≡ text-meta */\n --text-compact: var(--kai-text-compact, 0.8125rem); --text-compact--line-height: calc(1.21875 / 0.8125); /* 13px — dense chrome & code: a notch below body */\n --text-body: var(--kai-text-body, 0.875rem); --text-body--line-height: calc(1.25 / 0.875); /* 14px — primary reading text */\n --text-sm: var(--kai-text-body, 0.875rem); --text-sm--line-height: calc(1.25 / 0.875); /* ≡ text-body */\n --text-title: var(--kai-text-title, 1rem); --text-title--line-height: calc(1.5 / 1); /* 16px — emphasis / headers */\n --text-base: var(--kai-text-title, 1rem); --text-base--line-height: calc(1.5 / 1); /* ≡ text-title */\n --text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */\n\n @keyframes typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }\n @keyframes loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }\n @keyframes wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }\n @keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }\n @keyframes text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }\n @keyframes bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }\n @keyframes thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }\n @keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }\n @keyframes shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }\n @keyframes wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }\n @keyframes shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }\n @keyframes spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }\n @keyframes collapsible-down { from { height: 0; opacity: 0 } to { height: var(--kb-collapsible-content-height); opacity: 1 } }\n @keyframes collapsible-up { from { height: var(--kb-collapsible-content-height); opacity: 1 } to { height: 0; opacity: 0 } }\n}\n\n.dark {\n --color-background: var(--kai-color-background, hsl(50 2% 9%));\n --color-foreground: var(--kai-color-foreground, hsl(0 0% 98%));\n --color-card: var(--kai-color-card, hsl(45 4% 12%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(0 0% 98%));\n --color-popover: var(--kai-color-popover, hsl(45 4% 12%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(0 0% 98%));\n --color-primary: var(--kai-color-primary, hsl(0 0% 98%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(45 4% 11%));\n --color-secondary: var(--kai-color-secondary, hsl(45 4% 17%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(0 0% 98%));\n --color-muted: var(--kai-color-muted, hsl(45 4% 17%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(45 4% 64%));\n /* Re-declared in the dark scope so the color-mix recomputes with the DARK\n muted/background (a derived token is computed where it's declared, not where\n it's used — see the light --color-surface for the full note). */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n /* Sunken: in dark a LOWER muted% is darker (blends toward the dark background). */\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 18%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(45 4% 17%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(0 0% 98%));\n --color-destructive: var(--kai-color-destructive, hsl(0 62.8% 30.6%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - dark mode flips to the brighter tool-* dark hues\n (matching the chip values) carried over a near-black foreground, so the color\n both reads as text on a dark soft tint AND backs a legible foreground. See\n the light @theme note. */\n --color-success: var(--kai-color-success, hsl(142 71% 45%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(45 4% 11%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 50%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(45 4% 11%));\n --color-info: var(--kai-color-info, hsl(217 91% 70%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(45 4% 11%));\n /* Soft status surfaces + interaction states - re-declared so each color-mix\n recomputes with the DARK hues/background (a derived token resolves where it's\n declared; see the light block for the full note). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* Marked text — dark. A deep warm amber rather than the light yellow: a pale\n highlighter on a near-black field would blow out and force the text to flip\n colour. See the light block for the full note. */\n --color-highlight: var(--kai-color-highlight, hsl(40 75% 26%));\n /* Selected text — dark. A deep blue rather than the light one, for the same\n reason the mark darkens. See the light block for the full note. */\n --color-selection: var(--kai-color-selection, hsl(217 60% 32%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(0 0% 98%));\n --color-border: var(--kai-color-border, hsl(45 4% 17%));\n /* Control boundary — see the light block. Lifted to clear 3:1 (SC 1.4.11)\n against the dark background and card surfaces. */\n --color-input: var(--kai-color-input, hsl(45 4% 48%));\n --color-ring: var(--kai-color-ring, hsl(217 91% 68%));\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(45 3% 30%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(45 3% 42%));\n --color-sidebar: var(--kai-color-sidebar, hsl(50 2% 7%));\n --color-code-foreground: var(--kai-color-code-foreground, hsl(213 94% 78%));\n\n /* Tool/status chip hues — dark mode. Brighter hues reach AA on the dark fill. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 70%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 50%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 45%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 84% 70%));\n}\n\n/* Self-contained markdown styling — replaces the typography plugin's `prose`.\n Keyed on --color-* tokens so it themes with the rest of the kit. */\n.chat-markdown { color: var(--color-foreground); line-height: 1.6; }\n.chat-markdown > div:first-child > :first-child { margin-top: 0; }\n.chat-markdown > div:last-child > :last-child { margin-bottom: 0; }\n.chat-markdown p { margin: 0 0 0.75em; }\n.chat-markdown p:last-child { margin-bottom: 0; }\n.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4 {\n margin: 1.2em 0 0.5em; font-weight: 600; line-height: 1.3; color: var(--color-foreground);\n}\n.chat-markdown h1 { font-size: 1.4em; } .chat-markdown h2 { font-size: 1.25em; }\n.chat-markdown h3 { font-size: 1.1em; } .chat-markdown h4 { font-size: 1em; }\n.chat-markdown ul, .chat-markdown ol { margin: 0 0 0.75em; padding-left: 1.4em; }\n.chat-markdown li { margin: 0.2em 0; }\n.chat-markdown ul { list-style: disc; } .chat-markdown ol { list-style: decimal; }\n.chat-markdown a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }\n.chat-markdown strong { font-weight: 600; color: var(--color-foreground); }\n.chat-markdown em { font-style: italic; }\n.chat-markdown blockquote {\n margin: 0 0 0.75em; padding-left: 0.9em; border-left: 2px solid var(--color-border);\n color: var(--color-muted-foreground);\n}\n.chat-markdown hr { margin: 1em 0; border: 0; border-top: 1px solid var(--color-border); }\n.chat-markdown code:not(pre code) {\n background: color-mix(in oklab, var(--color-code-foreground) 15%, transparent);\n color: var(--color-code-foreground);\n border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em;\n font-family: var(--kai-font-code, ui-monospace, \"SF Mono\", Menlo, monospace);\n}\n.chat-markdown table { width: 100%; border-collapse: collapse; margin: 0 0 0.75em; font-size: 0.9em; }\n.chat-markdown th, .chat-markdown td { border: 1px solid var(--color-border); padding: 0.4em 0.6em; text-align: left; }\n.chat-markdown th { font-weight: 600; background: color-mix(in oklab, var(--color-muted-foreground) 8%, transparent); }\n\n/* Themeable elevation. The kit is mostly flat (borders), but a few surfaces lift\n off the page — popovers, dropdowns, hover cards, cards. The shadow COLOR is a\n token (--kai-shadow-color, default near-black); set it transparent for a fully\n flat look, or tint it to match a theme. Defined here (not as a Tailwind shadow\n utility) so the color stays overridable and works in both the web-component and\n SolidJS layers. */\n.kai-elevation {\n box-shadow:\n 0 4px 12px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 14%, transparent),\n 0 2px 6px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 10%, transparent);\n}\n.kai-elevation-sm {\n box-shadow: 0 1px 2px 0 color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 8%, transparent);\n}\n\n/* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea\n and any scroll region in the SolidJS-component build (web components also get\n this globally inside their shadow root — see src/elements/styles.css). */\n.scrollbar-thin {\n scrollbar-width: thin;\n scrollbar-color: var(--color-scrollbar-thumb) transparent;\n}\n.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }\n.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }\n.scrollbar-thin::-webkit-scrollbar-thumb {\n background-color: var(--color-scrollbar-thumb);\n border-radius: 9999px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n.scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }\n.scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }\n\n/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,\n theme-derived surface tokens (see --color-surface above). Defined explicitly\n because a color-mix-valued @theme token does NOT emit a bare `bg-` utility on\n its own (only opacity variants). Use these for panels that sit OVER content\n instead of `bg-muted/NN`. */\n@utility bg-surface {\n background-color: var(--color-surface);\n}\n@utility bg-surface-strong {\n background-color: var(--color-surface-strong);\n}\n@utility bg-surface-sunken {\n background-color: var(--color-surface-sunken);\n}\n\n/* Soft-status + interaction-state utilities. Same reason as bg-surface above: a\n color-mix-valued @theme token does NOT emit a bare `bg-` utility on its own, so\n bg-success-soft / bg-warning-soft / bg-info-soft / bg-destructive-soft and\n bg-hover / bg-selected are declared here. (The SOLID tokens - success / warning\n / info + their -foreground - are plain hsl values, so bg-success / text-success\n etc. ARE auto-generated by @theme and need no explicit utility.) */\n@utility bg-success-soft {\n background-color: var(--color-success-soft);\n}\n@utility bg-warning-soft {\n background-color: var(--color-warning-soft);\n}\n@utility bg-info-soft {\n background-color: var(--color-info-soft);\n}\n@utility bg-destructive-soft {\n background-color: var(--color-destructive-soft);\n}\n@utility bg-hover {\n background-color: var(--color-hover);\n}\n@utility bg-selected {\n background-color: var(--color-selected);\n}\n";
|
|
9000
|
+
const themeCss = "/* @kitn.ai/ui design system — import after `@import \"tailwindcss\"`.\n Defines ONLY namespaced (--color-*) tokens, component keyframes, animation\n utilities, and the .chat-markdown styles. Contains NO global base/reset rules,\n so importing it restyles nothing on its own — a host opts in via the kit's\n components + classes. Rebrand by overriding the --color-* values (optionally\n scoped to a subtree).\n NOTE: This file is Tailwind-v4 source (requires tailwindcss as a peer). For\n bundler-based apps that don't use Tailwind, import @kitn.ai/ui/theme.tokens.css\n instead — it is plain compiled CSS with no toolchain requirements. */\n\n@custom-variant dark (&:is(.dark *));\n\n@theme {\n --color-background: var(--kai-color-background, hsl(0 0% 100%));\n --color-foreground: var(--kai-color-foreground, hsl(240 10% 3.9%));\n --color-card: var(--kai-color-card, hsl(0 0% 100%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(240 10% 3.9%));\n --color-popover: var(--kai-color-popover, hsl(0 0% 100%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(240 10% 3.9%));\n --color-primary: var(--kai-color-primary, hsl(240 5.9% 10%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(0 0% 98%));\n --color-secondary: var(--kai-color-secondary, hsl(240 4.8% 95.9%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(240 5.9% 10%));\n --color-muted: var(--kai-color-muted, hsl(240 4.8% 95.9%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(240 3.8% 43%));\n /* Subtle SURFACE — an opaque \"muted panel\" for things that sit OVER content\n (the prompt input, message bubbles, artifact/card headers, chips). CALCULATED\n from existing tokens — `--color-muted` blended 40% onto `--color-background`\n — so it tracks the theme (incl. dark) automatically and needs no hand-picked\n value. SOLID (no alpha), so nothing behind it bleeds through. This replaces\n ad-hoc `bg-muted/40` surfaces. Retint via the --kai-color-surface knob (or a\n bare value); --color-surface-strong is the stronger step (hover/raised) and\n --color-surface-sunken is recessed BELOW the base surface (wells, or a banner\n that sits behind a card). Sunken is theme-specific: \"darker than the card\"\n means a LOWER muted% in dark but a HIGHER one in light, so the two scopes\n can't share a number — see the .dark block. */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 85%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(240 4.8% 95.9%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(240 5.9% 10%));\n --color-destructive: var(--kai-color-destructive, hsl(0 72% 45%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - solid fills with a legible foreground, matched to\n the kit's tool-green / -amber / -blue hues so they read on-brand. Use\n bg-success / bg-warning / bg-info with the matching -foreground for badges,\n banners, and buttons; or text-success / -warning / -info on a soft tint\n (below). destructive (above) is the danger/error member of the same family.\n Light uses darker hues so the color carries a light foreground AND stays\n legible as text on a pale tint; dark (see .dark) flips to brighter hues over\n a near-black foreground. Override via --kai-color-success / -warning / -info\n (+ -foreground). */\n --color-success: var(--kai-color-success, hsl(142 71% 30%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(0 0% 98%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 30%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(0 0% 98%));\n --color-info: var(--kai-color-info, hsl(217 91% 42%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(0 0% 98%));\n /* Soft tinted status surfaces - OPAQUE, theme-tracking fills derived as ~14% of\n the status hue blended onto the background. Use these for subtle callouts /\n banners instead of an eyeballed bg-success/10; pair with text-success /\n -warning / -info / -destructive. Derived, so declared in BOTH light and dark\n (a color-mix resolves where it's declared - see the surface tokens above). A\n bare bg- utility for a color-mix token is added at the bottom (see bg-surface). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n /* Interaction-state backgrounds - opaque, theme-tracking fills for row/control\n states so consumers stop eyeballing /10 opacities. --color-hover is a subtle\n neutral (a little --color-muted on the background); --color-selected is a\n faint --color-primary tint so a selected row tracks the brand. Use bg-hover /\n bg-selected. Derived, so declared in BOTH light and dark; bare bg- utilities\n added at the bottom. */\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* UNREAD indicator — a dedicated token (owner ruling, 2026-08-26), not a\n reuse of --color-destructive: unread is notification semantics, not\n error, so a consumer re-theming \"danger\" red must not also move every\n unread dot. Used identically by all three places an unread conversation\n surfaces: the list-row trailing dot (ConversationPanel), the header\n toggle's badge (ChatThread), and Dock's own closed-launcher badge.\n A vivid \"messenger red\" (Tailwind red-500 territory, the Intercom/iOS\n badge convention) rather than the darker --color-destructive hue: the\n first pass at this token picked a color that read as legible-on-paper\n but visually flat/dark next to the launcher's near-black ring. This one\n value is used in BOTH light and dark (no .dark override below) because\n it independently clears 3:1 (WCAG 1.4.11, non-text) against every real\n surface an unread dot sits on in EITHER mode: light row/card background\n (white) 3.78:1, light Dock-launcher ring (--color-primary, near-black)\n 4.68:1, dark row/card background (near-black) 4.73–4.35:1, dark\n Dock-launcher ring (--color-primary, near-white) 3.62:1. (Measured via\n the WCAG relative-luminance formula against this file's own light/dark\n --color-background/-card/-primary values — see\n .superpowers/sdd/2026-08-26-conversations/rework-report.md Round 4 for\n the worked numbers.) Override via --kai-color-unread; a construct author\n can also set it per-widget through `theme.unreadColor` (construct\n vocabulary — see agent-tooling/construct/schema.ts). */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* MARKED text — the fill behind a keyword the app has flagged (the composer's\n `highlights` rules, decorated through the CSS Custom Highlight API). This is\n `<mark>`, not a selection and not a status: a warm yellow, the convention\n every browser already ships for <mark> and every reader already reads as\n \"someone marked this\". Deliberately NOT derived from --color-primary — that\n token is a NEUTRAL near-black in light and near-white in dark, so any tint of\n it is grey, which is why the highlight used to be invisible. Also not blue\n (the browser's own ::selection is blue — a highlight must not read as a\n selection), not red (error) and not the skill/agent pill hues (blue/violet).\n OPAQUE, so it composites predictably over whichever field it lands on.\n Override via --kai-color-highlight. Light: near-black text over it is 15.6:1;\n dark: near-white text over it is 6.7:1 — both well clear of WCAG AA. */\n --color-highlight: var(--kai-color-highlight, hsl(45 96% 78%));\n /* SELECTED text — the kit's own ::selection fill, applied inside every kai-*\n shadow root (see src/elements/styles.css for the scoping rationale). The kit\n owns this because leaving it to the UA meant the browser's blue outranked the\n kit's own deliberate emphasis: a marked keyword was LESS prominent than an\n incidental drag-select. Stays in the cool/blue family the UA trained everyone\n to read as \"selected\", so it can never be confused with the warm --color-highlight\n mark above; OPAQUE, so a selection over a mark composites cleanly (selection\n paints on top of a custom highlight) instead of muddying into a third colour.\n The FOREGROUND is set too, and that is not cosmetic: without it the selected\n glyph keeps its own colour, and the kit's coloured text — muted text (3.8:1),\n the skill/agent pill hues (3.6:1 / 4.0:1), inline code (4.7:1) — lands at or\n under WCAG AA on this fill. Forcing the foreground token makes the guarantee\n hold for every glyph regardless of what colour it had. Light 13.99:1,\n dark 8.87:1. Override via --kai-color-selection(-foreground). */\n --color-selection: var(--kai-color-selection, hsl(213 94% 87%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(240 10% 3.9%));\n --color-border: var(--kai-color-border, hsl(240 5.9% 90%));\n /* CONTROL boundary — the visible edge of an interactive form control (text\n input, textarea, select, the radio/checkbox ring). WCAG 2.1 SC 1.4.11\n Non-text Contrast requires >=3:1 against the adjacent surface for exactly\n this: a control whose boundary you cannot see is not perceivable. That is\n why this is NOT --color-border: a divider or a card outline is decorative\n and may sit below 3:1, a control's edge may not. Do NOT use border-input\n for list wrappers or panel outlines — use border-border there.\n Contrast is the requirement; a thicker border does not satisfy 1.4.11. */\n --color-input: var(--kai-color-input, hsl(240 5% 53%));\n /* Focus ring — a deliberate blue (not a neutral) so keyboard focus is always\n obvious and on-brand in both modes. Light uses a strong blue; dark uses a\n brighter one for contrast on dark surfaces. Both clear WCAG 2.1 non-text\n contrast (≥3:1) against the kit's backgrounds. Override via --kai-color-ring. */\n --color-ring: var(--kai-color-ring, hsl(217 91% 53%));\n /* Custom scrollbars — thin, rounded, subtle; thumb strengthens on hover. A\n consistent cross-platform look (the kit styles its OWN scroll regions inside\n the shadow root; the track stays transparent so nothing is forced where no\n scrollbar is needed). Override via --kai-color-scrollbar-thumb(-hover). */\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(240 5% 80%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(240 4% 64%));\n --color-sidebar: var(--kai-color-sidebar, hsl(0 0% 100%));\n\n /* Inline `code` accent. Blue text on a translucent blue chip. */\n --color-code-foreground: var(--kai-color-code-foreground, hsl(224.3 76.3% 48%));\n\n /* Tool/status chip hues. Each chip is hue text over a 15% translucent fill of\n the SAME hue (set in tool.tsx). The bare hue is too light to reach WCAG AA\n (4.5:1) on the faint fill in LIGHT mode, so the light values are darkened;\n dark mode keeps brighter hues for AA on the dark fill. Override via\n --kai-color-tool-* to retheme. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 38%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 28%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 26%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 72% 42%));\n\n --radius: var(--kai-radius, 0.6rem);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n\n /* Typography scale — ONE scale for the whole kit. Each semantic name\n (text-micro / text-caption / text-meta / text-compact / text-body /\n text-title / text-lg)\n resolves through a namespaced --kai-text-* token, so overriding that token\n on :root restyles the kit globally — it pierces the Shadow DOM via the\n var() fallback, exactly like the --kai-color-* tokens. The bare --text-*\n names stay internal so a host's own --text-* can't collide.\n\n Tailwind's OWN scale is re-pointed at the same tokens: in Tailwind v4 the\n `text-xs` / `text-sm` / `text-base` / `text-lg` utilities are generated FROM\n --text-xs/sm/base/lg in this very @theme block, so aliasing them makes\n text-xs ≡ text-meta, text-sm ≡ text-body, text-base ≡ text-title and\n text-lg ≡ text-lg. That matters because the vast majority of the kit's call\n sites spell the Tailwind name; without the alias the --kai-text-* knobs\n reached ~12% of them and the \"globally\" promise in the theming guide was\n false. Defaults are byte-identical to stock Tailwind, so nothing moves\n until a consumer actually sets a --kai-text-* token — including in a\n consumer's own Tailwind build that imports this file, which is the point:\n one scale everywhere, kit and app moving together.\n\n Line-heights are UNITLESS RATIOS (Tailwind's own), never fixed rem. A fixed\n leading does not scale: --kai-text-body: 1.25rem under the old 1.45rem\n leading gave 20px text on 23.2px leading — near solid-set — which made the\n themable token unsafe to actually theme.\n (Message/markdown reading size also scales with the `proseSize` prop; these\n tokens cover the fixed chrome & controls.) */\n --text-micro: var(--kai-text-micro, 0.625rem); --text-micro--line-height: calc(0.875 / 0.625); /* 10px — badges, pills, uppercase eyebrows */\n --text-caption: var(--kai-text-caption, 0.6875rem); --text-caption--line-height: calc(1 / 0.6875); /* 11px — micro labels, sub-counts, xs code */\n --text-meta: var(--kai-text-meta, 0.75rem); --text-meta--line-height: calc(1 / 0.75); /* 12px — controls, toggles, switchers, captions */\n --text-xs: var(--kai-text-meta, 0.75rem); --text-xs--line-height: calc(1 / 0.75); /* ≡ text-meta */\n --text-compact: var(--kai-text-compact, 0.8125rem); --text-compact--line-height: calc(1.21875 / 0.8125); /* 13px — dense chrome & code: a notch below body */\n --text-body: var(--kai-text-body, 0.875rem); --text-body--line-height: calc(1.25 / 0.875); /* 14px — primary reading text */\n --text-sm: var(--kai-text-body, 0.875rem); --text-sm--line-height: calc(1.25 / 0.875); /* ≡ text-body */\n --text-title: var(--kai-text-title, 1rem); --text-title--line-height: calc(1.5 / 1); /* 16px — emphasis / headers */\n --text-base: var(--kai-text-title, 1rem); --text-base--line-height: calc(1.5 / 1); /* ≡ text-title */\n --text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */\n\n @keyframes typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }\n @keyframes loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }\n @keyframes wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }\n @keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }\n @keyframes text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }\n @keyframes bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }\n @keyframes thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }\n @keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }\n @keyframes shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }\n @keyframes wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }\n @keyframes shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }\n @keyframes spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }\n @keyframes collapsible-down { from { height: 0; opacity: 0 } to { height: var(--kb-collapsible-content-height); opacity: 1 } }\n @keyframes collapsible-up { from { height: var(--kb-collapsible-content-height); opacity: 1 } to { height: 0; opacity: 0 } }\n}\n\n.dark {\n --color-background: var(--kai-color-background, hsl(50 2% 9%));\n --color-foreground: var(--kai-color-foreground, hsl(0 0% 98%));\n --color-card: var(--kai-color-card, hsl(45 4% 12%));\n --color-card-foreground: var(--kai-color-card-foreground, hsl(0 0% 98%));\n --color-popover: var(--kai-color-popover, hsl(45 4% 12%));\n --color-popover-foreground: var(--kai-color-popover-foreground, hsl(0 0% 98%));\n --color-primary: var(--kai-color-primary, hsl(0 0% 98%));\n --color-primary-foreground: var(--kai-color-primary-foreground, hsl(45 4% 11%));\n --color-secondary: var(--kai-color-secondary, hsl(45 4% 17%));\n --color-secondary-foreground: var(--kai-color-secondary-foreground, hsl(0 0% 98%));\n --color-muted: var(--kai-color-muted, hsl(45 4% 17%));\n --color-muted-foreground: var(--kai-color-muted-foreground, hsl(45 4% 64%));\n /* Re-declared in the dark scope so the color-mix recomputes with the DARK\n muted/background (a derived token is computed where it's declared, not where\n it's used — see the light --color-surface for the full note). */\n --color-surface: var(--kai-color-surface, color-mix(in srgb, var(--color-muted) 40%, var(--color-background)));\n --color-surface-strong: var(--kai-color-surface-strong, color-mix(in srgb, var(--color-muted) 60%, var(--color-background)));\n /* Sunken: in dark a LOWER muted% is darker (blends toward the dark background). */\n --color-surface-sunken: var(--kai-color-surface-sunken, color-mix(in srgb, var(--color-muted) 18%, var(--color-background)));\n --color-accent: var(--kai-color-accent, hsl(45 4% 17%));\n --color-accent-foreground: var(--kai-color-accent-foreground, hsl(0 0% 98%));\n --color-destructive: var(--kai-color-destructive, hsl(0 62.8% 30.6%));\n --color-destructive-foreground: var(--kai-color-destructive-foreground, hsl(0 0% 98%));\n /* Semantic status colors - dark mode flips to the brighter tool-* dark hues\n (matching the chip values) carried over a near-black foreground, so the color\n both reads as text on a dark soft tint AND backs a legible foreground. See\n the light @theme note. */\n --color-success: var(--kai-color-success, hsl(142 71% 45%));\n --color-success-foreground: var(--kai-color-success-foreground, hsl(45 4% 11%));\n --color-warning: var(--kai-color-warning, hsl(38 92% 50%));\n --color-warning-foreground: var(--kai-color-warning-foreground, hsl(45 4% 11%));\n --color-info: var(--kai-color-info, hsl(217 91% 70%));\n --color-info-foreground: var(--kai-color-info-foreground, hsl(45 4% 11%));\n /* Soft status surfaces + interaction states - re-declared so each color-mix\n recomputes with the DARK hues/background (a derived token resolves where it's\n declared; see the light block for the full note). */\n --color-success-soft: var(--kai-color-success-soft, color-mix(in oklab, var(--color-success) 14%, var(--color-background)));\n --color-warning-soft: var(--kai-color-warning-soft, color-mix(in oklab, var(--color-warning) 14%, var(--color-background)));\n --color-info-soft: var(--kai-color-info-soft, color-mix(in oklab, var(--color-info) 14%, var(--color-background)));\n --color-destructive-soft: var(--kai-color-destructive-soft, color-mix(in oklab, var(--color-destructive) 14%, var(--color-background)));\n --color-hover: var(--kai-color-hover, color-mix(in oklab, var(--color-muted) 60%, var(--color-background)));\n --color-selected: var(--kai-color-selected, color-mix(in oklab, var(--color-primary) 8%, var(--color-background)));\n /* Unread indicator — dark. Same value as light (see the light block for the\n full contrast note): one vivid red independently clears 3:1 against both\n modes' real surfaces, so there is nothing to flip here. Still redeclared\n for override symmetry with every other semantic color in this file. */\n --color-unread: var(--kai-color-unread, hsl(0 84% 60%));\n /* Marked text — dark. A deep warm amber rather than the light yellow: a pale\n highlighter on a near-black field would blow out and force the text to flip\n colour. See the light block for the full note. */\n --color-highlight: var(--kai-color-highlight, hsl(40 75% 26%));\n /* Selected text — dark. A deep blue rather than the light one, for the same\n reason the mark darkens. See the light block for the full note. */\n --color-selection: var(--kai-color-selection, hsl(217 60% 32%));\n --color-selection-foreground: var(--kai-color-selection-foreground, hsl(0 0% 98%));\n --color-border: var(--kai-color-border, hsl(45 4% 17%));\n /* Control boundary — see the light block. Lifted to clear 3:1 (SC 1.4.11)\n against the dark background and card surfaces. */\n --color-input: var(--kai-color-input, hsl(45 4% 48%));\n --color-ring: var(--kai-color-ring, hsl(217 91% 68%));\n --color-scrollbar-thumb: var(--kai-color-scrollbar-thumb, hsl(45 3% 30%));\n --color-scrollbar-thumb-hover: var(--kai-color-scrollbar-thumb-hover, hsl(45 3% 42%));\n --color-sidebar: var(--kai-color-sidebar, hsl(50 2% 7%));\n --color-code-foreground: var(--kai-color-code-foreground, hsl(213 94% 78%));\n\n /* Tool/status chip hues — dark mode. Brighter hues reach AA on the dark fill. */\n --color-tool-blue: var(--kai-color-tool-blue, hsl(217 91% 70%));\n --color-tool-amber: var(--kai-color-tool-amber, hsl(38 92% 50%));\n --color-tool-green: var(--kai-color-tool-green, hsl(142 71% 45%));\n --color-tool-red: var(--kai-color-tool-red, hsl(0 84% 70%));\n}\n\n/* Self-contained markdown styling — replaces the typography plugin's `prose`.\n Keyed on --color-* tokens so it themes with the rest of the kit. */\n.chat-markdown { color: var(--color-foreground); line-height: 1.6; }\n.chat-markdown > div:first-child > :first-child { margin-top: 0; }\n.chat-markdown > div:last-child > :last-child { margin-bottom: 0; }\n.chat-markdown p { margin: 0 0 0.75em; }\n.chat-markdown p:last-child { margin-bottom: 0; }\n.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4 {\n margin: 1.2em 0 0.5em; font-weight: 600; line-height: 1.3; color: var(--color-foreground);\n}\n.chat-markdown h1 { font-size: 1.4em; } .chat-markdown h2 { font-size: 1.25em; }\n.chat-markdown h3 { font-size: 1.1em; } .chat-markdown h4 { font-size: 1em; }\n.chat-markdown ul, .chat-markdown ol { margin: 0 0 0.75em; padding-left: 1.4em; }\n.chat-markdown li { margin: 0.2em 0; }\n.chat-markdown ul { list-style: disc; } .chat-markdown ol { list-style: decimal; }\n.chat-markdown a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }\n.chat-markdown strong { font-weight: 600; color: var(--color-foreground); }\n.chat-markdown em { font-style: italic; }\n.chat-markdown blockquote {\n margin: 0 0 0.75em; padding-left: 0.9em; border-left: 2px solid var(--color-border);\n color: var(--color-muted-foreground);\n}\n.chat-markdown hr { margin: 1em 0; border: 0; border-top: 1px solid var(--color-border); }\n.chat-markdown code:not(pre code) {\n background: color-mix(in oklab, var(--color-code-foreground) 15%, transparent);\n color: var(--color-code-foreground);\n border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em;\n font-family: var(--kai-font-code, ui-monospace, \"SF Mono\", Menlo, monospace);\n}\n.chat-markdown table { width: 100%; border-collapse: collapse; margin: 0 0 0.75em; font-size: 0.9em; }\n.chat-markdown th, .chat-markdown td { border: 1px solid var(--color-border); padding: 0.4em 0.6em; text-align: left; }\n.chat-markdown th { font-weight: 600; background: color-mix(in oklab, var(--color-muted-foreground) 8%, transparent); }\n\n/* Themeable elevation. The kit is mostly flat (borders), but a few surfaces lift\n off the page — popovers, dropdowns, hover cards, cards. The shadow COLOR is a\n token (--kai-shadow-color, default near-black); set it transparent for a fully\n flat look, or tint it to match a theme. Defined here (not as a Tailwind shadow\n utility) so the color stays overridable and works in both the web-component and\n SolidJS layers. */\n.kai-elevation {\n box-shadow:\n 0 4px 12px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 14%, transparent),\n 0 2px 6px -2px color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 10%, transparent);\n}\n.kai-elevation-sm {\n box-shadow: 0 1px 2px 0 color-mix(in oklab, var(--kai-shadow-color, oklch(0 0 0)) 8%, transparent);\n}\n\n/* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea\n and any scroll region in the SolidJS-component build (web components also get\n this globally inside their shadow root — see src/elements/styles.css). */\n.scrollbar-thin {\n scrollbar-width: thin;\n scrollbar-color: var(--color-scrollbar-thumb) transparent;\n}\n.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }\n.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }\n.scrollbar-thin::-webkit-scrollbar-thumb {\n background-color: var(--color-scrollbar-thumb);\n border-radius: 9999px;\n border: 2px solid transparent;\n background-clip: padding-box;\n}\n.scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }\n.scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }\n\n/* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,\n theme-derived surface tokens (see --color-surface above). Defined explicitly\n because a color-mix-valued @theme token does NOT emit a bare `bg-` utility on\n its own (only opacity variants). Use these for panels that sit OVER content\n instead of `bg-muted/NN`. */\n@utility bg-surface {\n background-color: var(--color-surface);\n}\n@utility bg-surface-strong {\n background-color: var(--color-surface-strong);\n}\n@utility bg-surface-sunken {\n background-color: var(--color-surface-sunken);\n}\n\n/* Soft-status + interaction-state utilities. Same reason as bg-surface above: a\n color-mix-valued @theme token does NOT emit a bare `bg-` utility on its own, so\n bg-success-soft / bg-warning-soft / bg-info-soft / bg-destructive-soft and\n bg-hover / bg-selected are declared here. (The SOLID tokens - success / warning\n / info + their -foreground - are plain hsl values, so bg-success / text-success\n etc. ARE auto-generated by @theme and need no explicit utility.) */\n@utility bg-success-soft {\n background-color: var(--color-success-soft);\n}\n@utility bg-warning-soft {\n background-color: var(--color-warning-soft);\n}\n@utility bg-info-soft {\n background-color: var(--color-info-soft);\n}\n@utility bg-destructive-soft {\n background-color: var(--color-destructive-soft);\n}\n@utility bg-hover {\n background-color: var(--color-hover);\n}\n@utility bg-selected {\n background-color: var(--color-selected);\n}\n";
|
|
9001
9001
|
function declaredKaiTokens(css) {
|
|
9002
9002
|
const names = /* @__PURE__ */ new Set();
|
|
9003
9003
|
for (const m of css.matchAll(/var\(\s*(--kai-[a-zA-Z0-9-]+)\s*[,)]/g)) names.add(m[1]);
|
|
@@ -9544,6 +9544,21 @@ const ConstructSchema = z$1.object({
|
|
|
9544
9544
|
theme: z$1.object({
|
|
9545
9545
|
/** Any CSS color; becomes --kai-color-primary on the host. */
|
|
9546
9546
|
accent: z$1.string().optional(),
|
|
9547
|
+
/** Any CSS color; becomes --kai-color-unread on the host (owner
|
|
9548
|
+
* ruling, 2026-08-26 — the unread-indicator round). Same treatment
|
|
9549
|
+
* as `accent` in every way that matters for safety: construct-
|
|
9550
|
+
* authored/untrusted text, carried to the emitted facade via
|
|
9551
|
+
* `ctx.element.style.setProperty('--kai-color-unread',
|
|
9552
|
+
* JSON.stringify(...))` — never string-interpolated into CSS
|
|
9553
|
+
* text — so it can never break out into a new declaration or rule
|
|
9554
|
+
* (see emitElement's doc on why `accent` uses setProperty at all).
|
|
9555
|
+
* Unlike `accent`, this has no paired -foreground to compute: the
|
|
9556
|
+
* three surfaces that read --color-unread (the conversation-list
|
|
9557
|
+
* row dot, the header toggle's badge, Dock's own closed-launcher
|
|
9558
|
+
* badge) are all small filled dots with no text sitting ON them, so
|
|
9559
|
+
* there is nothing to contrast-pair — the value is set and used
|
|
9560
|
+
* as-is. */
|
|
9561
|
+
unreadColor: z$1.string().optional(),
|
|
9547
9562
|
mode: z$1.enum(["light", "dark", "system"]).default("system")
|
|
9548
9563
|
}).strict().optional(),
|
|
9549
9564
|
/** Construct-wide header chrome, valid on every layout (not layout-scoped
|
|
@@ -9577,6 +9592,30 @@ const ConstructSchema = z$1.object({
|
|
|
9577
9592
|
description: z$1.string().min(1).optional(),
|
|
9578
9593
|
icon: z$1.string().min(1).optional()
|
|
9579
9594
|
}).strict().optional(),
|
|
9595
|
+
/** Home screen (spec 2026-08-27, H-1..H-5): Intercom-style landing view behind
|
|
9596
|
+
* a Home/Messages tab bar. PRESENCE of `home` enables the tab chrome (H-4) —
|
|
9597
|
+
* no `enabled` boolean, like `header`/`empty`. Every sub-key optional;
|
|
9598
|
+
* `home: {}` still means "tabs on, defaults". Never requires another
|
|
9599
|
+
* capability (H-3): the recent card simply renders nothing without
|
|
9600
|
+
* `capabilities.conversations` (the CLI warns — see cli.ts). All strings are
|
|
9601
|
+
* construct-authored/untrusted: JSON.stringify'd at every emit site; hrefs
|
|
9602
|
+
* and URL-shaped icons through isSafeUrl in superRefine below. */
|
|
9603
|
+
home: z$1.object({
|
|
9604
|
+
greeting: z$1.object({ title: z$1.string().min(1).optional(), subtitle: z$1.string().min(1).optional() }).strict().optional(),
|
|
9605
|
+
recentConversation: z$1.literal(true).optional(),
|
|
9606
|
+
newConversation: z$1.object({ label: z$1.string().min(1).optional() }).strict().optional(),
|
|
9607
|
+
links: z$1.array(
|
|
9608
|
+
z$1.object({
|
|
9609
|
+
label: z$1.string().min(1),
|
|
9610
|
+
href: z$1.string().min(1).optional(),
|
|
9611
|
+
description: z$1.string().min(1).optional(),
|
|
9612
|
+
/** renderIcon name (e.g. 'book-open') or a safe URL — the icon NAME
|
|
9613
|
+
* list is renderIcon's own vocabulary, never restated here; unknown
|
|
9614
|
+
* names warn loudly at DEV runtime. */
|
|
9615
|
+
icon: z$1.string().min(1).optional()
|
|
9616
|
+
}).strict()
|
|
9617
|
+
).optional()
|
|
9618
|
+
}).strict().optional(),
|
|
9580
9619
|
// Capability vocabulary, widened one field at a time by later tasks.
|
|
9581
9620
|
capabilities: z$1.object({
|
|
9582
9621
|
/** Starter prompts shown on the empty thread; clicking one sends it.
|
|
@@ -9630,7 +9669,18 @@ const ConstructSchema = z$1.object({
|
|
|
9630
9669
|
* Meaningless when `reasoning` is `'compact'` (no expandable
|
|
9631
9670
|
* content exists) or `'off'` (nothing renders); rejected on both,
|
|
9632
9671
|
* loudly, below. */
|
|
9633
|
-
reasoningOpen: z$1.boolean().optional()
|
|
9672
|
+
reasoningOpen: z$1.boolean().optional(),
|
|
9673
|
+
/** Turns on the prior-conversations list (C-1..C-9 of the
|
|
9674
|
+
* conversations design). `true` only — there is no `false` form,
|
|
9675
|
+
* matching this schema's other presence-only capability flags.
|
|
9676
|
+
* Requires `capabilities.history.persistence` to be `local` or
|
|
9677
|
+
* `endpoint` (superRefine below, loud): a conversation list with
|
|
9678
|
+
* nowhere to persist conversations is not a coherent construct.
|
|
9679
|
+
* WHAT persists (this field, plus history) stays construct
|
|
9680
|
+
* vocabulary; HOW it persists (the ConversationStore adapter,
|
|
9681
|
+
* localStorage vs. a fetch endpoint) is codegen's call, never
|
|
9682
|
+
* vocabulary here (C-3 — no transport-layer vocabulary). */
|
|
9683
|
+
conversations: z$1.literal(true).optional()
|
|
9634
9684
|
}).strict().optional(),
|
|
9635
9685
|
/** Named generative-UI card definitions the model can emit as tool calls,
|
|
9636
9686
|
* rendered in the thread. Top-level (not a capability): a card is
|
|
@@ -9740,6 +9790,30 @@ const ConstructSchema = z$1.object({
|
|
|
9740
9790
|
});
|
|
9741
9791
|
}
|
|
9742
9792
|
const history = construct.capabilities?.history;
|
|
9793
|
+
if (construct.capabilities?.conversations && (!history || history.persistence === "none")) {
|
|
9794
|
+
ctx.addIssue({
|
|
9795
|
+
code: z$1.ZodIssueCode.custom,
|
|
9796
|
+
path: ["capabilities", "conversations"],
|
|
9797
|
+
message: '"conversations" requires capabilities.history.persistence to be "local" or "endpoint" — a conversation list needs somewhere to persist conversations'
|
|
9798
|
+
});
|
|
9799
|
+
}
|
|
9800
|
+
const URL_SHAPED = /^[a-zA-Z][a-zA-Z0-9+.-]*:|^\/\//;
|
|
9801
|
+
for (const [i, link] of (construct.home?.links ?? []).entries()) {
|
|
9802
|
+
if (link.href && !isSafeUrl(link.href)) {
|
|
9803
|
+
ctx.addIssue({
|
|
9804
|
+
code: z$1.ZodIssueCode.custom,
|
|
9805
|
+
path: ["home", "links", i, "href"],
|
|
9806
|
+
message: "href must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
|
|
9807
|
+
});
|
|
9808
|
+
}
|
|
9809
|
+
if (link.icon && URL_SHAPED.test(link.icon) && !isSafeUrl(link.icon)) {
|
|
9810
|
+
ctx.addIssue({
|
|
9811
|
+
code: z$1.ZodIssueCode.custom,
|
|
9812
|
+
path: ["home", "links", i, "icon"],
|
|
9813
|
+
message: "icon must be a kit icon name or an http(s)/relative URL — no javascript:/data: schemes"
|
|
9814
|
+
});
|
|
9815
|
+
}
|
|
9816
|
+
}
|
|
9743
9817
|
if (!history) return;
|
|
9744
9818
|
if (history.persistence === "endpoint" && !history.url) {
|
|
9745
9819
|
ctx.addIssue({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as k,h as x,f as K,c as g,j as N,D as P,A as Q,o as H,C as V,S as w,m as T,i as X,a as Y,b as Z,v as $,t as A}from"./define-
|
|
1
|
+
import{g as k,h as x,f as K,c as g,j as N,D as P,A as Q,o as H,C as V,S as w,m as T,i as X,a as Y,b as Z,v as $,t as A}from"./define-By-uL588.js";import{r as ee,M as te}from"./slots-DaNjX0rc.js";import{a as z,M as re,b as ae}from"./message-BYZECyek.js";import{t as B}from"./toast-store-tgK6MuMv.js";import{B as O}from"./card-renderer-Jx70m6_l.js";import{m as ne,B as oe}from"./card-tags-D8lZ-C_U.js";function se(e){return e.filter(a=>a.type==="text").map(a=>a.text).join("")}const ie=2e3;function R(e){const[a,c]=k({}),[o,i]=k(new Set),v=e.copiedDuration??ie,n=new Map;x(()=>{n.forEach(r=>clearTimeout(r)),n.clear()});const u=r=>r.feedback??a()[r.id],h=r=>o().has(r),f=r=>{i(d=>{const l=new Set(d);return l.add(r),l});const s=n.get(r);s&&clearTimeout(s),n.set(r,setTimeout(()=>{n.delete(r),i(d=>{if(!d.has(r))return d;const l=new Set(d);return l.delete(r),l})},v))},b=(r,s)=>{c(d=>{const l={...d};return s===void 0?delete l[r]:l[r]=s,l})};return{resolveFeedback:u,isCopied:h,handleAction:(r,s)=>{var d,l,p;if(s==="copy"){try{(d=navigator.clipboard)==null||d.writeText(se(r.parts))}catch{}f(r.id),B("Copied to clipboard",{target:(l=e.target)==null?void 0:l.call(e)}),e.emit({messageId:r.id,action:s});return}if(s==="like"||s==="dislike"){u(r)===s?(b(r.id,void 0),e.emit({messageId:r.id,action:s,state:"off"})):(b(r.id,s),B("Thanks for your feedback",{target:(p=e.target)==null?void 0:p.call(e)}),e.emit({messageId:r.id,action:s,state:"on"}));return}e.emit({messageId:r.id,action:s})}}}function S(e){return!!e&&typeof e=="object"&&Array.isArray(e.parts)}const le="each entry needs a 'parts' array (e.g. parts: [{ type: 'text', text: 'Hi' }]). The 'content' string field was removed in 0.20.0.",ce=[];function de(e){const a=new WeakSet;let c=!1,o=!1;return i=>{if(!Array.isArray(i))return i!=null&&!o&&(o=!0,console.error(`<${e}>: 'messages' must be an array. Ignoring it.`)),ce;if(i.every(S))return i;let v=0,n=0;for(const u of i)if(!S(u)){if(v++,u!==null&&typeof u=="object"){if(a.has(u))continue;a.add(u)}else{if(c)continue;c=!0}n++}return n>0&&console.error(`<${e}>: skipped ${v} of ${i.length} messages: ${le}`),i.filter(S)}}var ue=A("<slot name=before-body>"),ge=A("<slot name=after-body>"),ve=A("<div part=avatar class=shrink-0><slot name=avatar>"),me=A("<div>");function _(e,a="auto"){const c=ne(e),o={};for(const i of Object.keys(c)){const v=c[i];o[i]=v===oe[i]&&O[i]?O[i]:n=>g(fe,{tag:v,get envelope(){return n.envelope},theme:a})}return o}function fe(e){let a;return N(()=>{a&&(a.data=e.envelope.data,a.cardId=e.envelope.id,e.envelope.title!=null&&(a.heading=e.envelope.title),a.resolution=e.envelope.resolution,a.setAttribute("theme",e.theme),a.setAttribute("data-card-id",e.envelope.id))}),g(P,{get component(){return e.tag},ref(c){var o=a;typeof o=="function"?o(c):a=c}})}function D(e){const a=e.getAttribute("role");a!==null&&(e.removeAttribute("role"),e.role=a)}K("kai-message",{message:void 0,role:"assistant",markdown:void 0,proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,actionsReveal:"always",avatarSrc:void 0,avatarFallback:void 0,avatar:void 0,cardTypes:void 0,cardSchemas:void 0},(e,{dispatch:a,flag:c,element:o,expose:i})=>{const v=Q();D(o);const n=()=>e.message??{id:"message",role:e.role??"assistant",parts:[]};let u;const h=()=>{const t=n();return S(t)?!0:(t!==u&&(u=t,console.error("<kai-message>: 'message' must have a 'parts' array. The 'content' string field was removed in 0.20.0.")),!1)},f=R({emit:t=>a("kai-message-action",t)});i({copy:()=>{h()&&f.handleAction(n(),"copy")}});const[b,r]=k([]),[s,d]=k({});H(()=>{const t=()=>{const J=[...o.querySelectorAll("kai-action")];r(J.map(m=>{var j;return{id:m.id||m.getAttribute("action")||"",label:((j=m.textContent)==null?void 0:j.trim())||m.getAttribute("label")||m.id||"",icon:m.getAttribute("icon")??void 0,tooltip:m.getAttribute("tooltip")??void 0}})),d(ee(o,te))};t();const y=new MutationObserver(t);y.observe(o,{childList:!0,attributes:!0,subtree:!0}),x(()=>y.disconnect())}),H(()=>{const t=new MutationObserver(()=>D(o));t.observe(o,{attributes:!0,attributeFilter:["role"]}),x(()=>t.disconnect())});const l=()=>n().role==="user",p=()=>n().avatar??(e.avatarSrc||e.avatarFallback?{src:e.avatarSrc,fallback:e.avatarFallback}:void 0),E=()=>e.avatar==="none",F=()=>!!s().avatar,q=()=>!E()&&(F()||!!p()),M=()=>e.actionsReveal==="hover"?"hover":"always",L=()=>o.hasAttribute("markdown")||e.markdown===!0||e.markdown===!1,U=()=>L()?c("markdown"):!l(),W=()=>[...n().actions??[],...b()],C=()=>g(re,{get parts(){return n().parts},get cardTypes(){return _(e.cardTypes,e.theme)},get cardSchemas(){return e.cardSchemas},cardHostElement:o,get isUser(){return l()},get markdown(){return U()},get actions(){return W()},get actionsReveal(){return M()},get activeFeedback(){return f.resolveFeedback(n())},get copied(){return f.isCopied(n().id)},onAction:t=>f.handleAction(n(),t),get beforeBody(){return T(()=>!!s()["before-body"])()?(()=>{var t=ue();return t._$owner=$(),t})():void 0},get afterBody(){return T(()=>!!s()["after-body"])()?(()=>{var t=ge();return t._$owner=$(),t})():void 0}}),I=()=>M()==="hover"?"group ":"",G=()=>g(w,{get when(){return F()},get fallback(){return g(w,{get when(){return p()},children:t=>g(ae,{get src(){return t().src??""},get alt(){return t().alt??""},get fallback(){return t().fallback}})})},get children(){var t=ve(),y=t.firstChild;return y._$owner=$(),t}});return g(w,{get when(){return h()},get children(){return g(V,{get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return c("codeHighlight")},get portalMount(){return v.portalMount()},get children(){return g(w,{get when(){return q()},get fallback(){return g(z,{get role(){return n().role},get class(){return`${I()}${l()?"flex-col items-end":"flex-col items-start"}`},get children(){return C()}})},get children(){return g(z,{get role(){return n().role},get class(){return I()},get children(){return[T(()=>G()),(()=>{var t=me();return X(t,C),Y(()=>Z(t,`flex min-w-0 flex-1 flex-col ${l()?"items-end":"items-start"}`)),t})()]}})}})}})}})});export{_ as a,de as b,R as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as S,p as A,q as B,m as w,i as g,k as D,c as r,S as c,r as F,M as o,F as z,a as x,d as k,I as E,b as
|
|
1
|
+
import{s as S,p as A,q as B,m as w,i as g,k as D,c as r,S as c,r as F,M as o,F as z,a as x,d as k,I as E,b as j,t as u,A as H,Q as q,e as L}from"./define-By-uL588.js";import{T as N}from"./tooltip-Bkkg_4t0.js";import{c as h}from"./cn-DN5AWfiS.js";import{M as P}from"./markdown-LMvmAyBk.js";import{B as Q}from"./button-DkuOnGLy.js";import{B as _,a as C}from"./action-icons-CcgNN2oT.js";import{R as $,a as G,b as J}from"./reasoning-4kBPtlTx.js";import{L as K}from"./loader-BM4CEz4G.js";import{T as V}from"./tool-DzUjIBT8.js";import{A as W,a as X,b as Y,c as Z,d as ee,e as re,f as te,g as O,h as ne}from"./attachments-Qr4kg-2b.js";import{S as ae,a as ie,b as le,c as se}from"./source-GEnFF528.js";import{a as ce}from"./card-renderer-Jx70m6_l.js";import{c as oe}from"./check-njkVdZu2.js";var ue=u("<div part=row>"),de=u('<img class="h-full w-full object-cover">'),ge=u("<div part=avatar>"),he=u('<div class="flex h-full w-full items-center justify-center bg-muted text-xs font-medium text-muted-foreground">'),R=u("<div>"),me=u('<span class="px-1 text-xs">'),fe=u('<span><span class="min-w-0 overflow-hidden">'),pe=u('<img class="block max-h-64 max-w-xs rounded object-contain">'),ve=u('<div class="text-body font-medium">'),be=u('<div class="text-muted-foreground text-caption">');const ke={user:"User message",assistant:"Assistant message",system:"System message"};function we(e){const[t,n]=S(e,["children","class","role"]);return(()=>{var a=ue();return A(a,B({get class(){return h("flex items-start gap-3",t.class)},get"data-role"(){return t.role},get role(){return t.role?"article":void 0},get"aria-label"(){return w(()=>!!t.role)()?ke[t.role]:void 0}},n),!1,!0),g(a,()=>t.children),a})()}function xe(e){return(()=>{var t=ge();return g(t,r(c,{get when(){return e.src},get fallback(){return r(c,{get when(){return e.fallback},get children(){var n=he();return g(n,()=>e.fallback),n}})},get children(){var n=de();return x(a=>{var i=e.src,l=e.alt??"";return i!==a.e&&k(n,"src",a.e=i),l!==a.t&&k(n,"alt",a.t=l),a},{e:void 0,t:void 0}),n}})),x(()=>j(t,h("h-8 w-8 shrink-0 overflow-hidden rounded-full",e.class))),t})()}function ye(e){const[t,n]=S(e,["children","markdown","class","part"]),a=H(),i=()=>h("min-w-0 rounded-lg p-2 text-foreground bg-secondary max-w-none break-words whitespace-normal",q(a.proseSize()),t.class);return r(c,{get when(){return t.markdown},get fallback(){return(()=>{var l=R();return A(l,B({get part(){return t.part},get class(){return i()}},n),!1,!0),g(l,()=>t.children),l})()},get children(){return r(P,{get part(){return t.part},get content(){return t.children},get class(){return i()}})}})}function Se(e){const[t,n]=S(e,["children","class"]);return(()=>{var a=R();return A(a,B({get class(){return h("flex items-center gap-0.5 mt-0.5",t.class)}},n),!1,!0),g(a,()=>t.children),a})()}function Ae(e){return typeof e=="string"?{id:e,label:_[e],Icon:C(e)}:{id:e.id,label:e.label,Icon:C(e.icon)}}function Be(e){return e==="like"||e==="dislike"?e:void 0}function Fe(e){return r(Se,{part:"actions",get class(){return h("mt-1 flex gap-0",e.reveal==="hover"&&"opacity-0 transition-opacity group-hover:opacity-100",e.class)},get children(){return r(z,{get each(){return e.actions},children:t=>{const n=Ae(t),a=()=>typeof t!="string"&&t.tooltip?t.tooltip:n.label,i=Be(t),l=()=>i!==void 0&&e.activeFeedback===i,d=n.id==="copy",m=()=>d&&e.copied===!0,s=()=>r(Q,{variant:"ghost",size:"icon-sm",get class(){return h("rounded-full",l()&&"text-primary")},get"data-action"(){return n.id},get"aria-label"(){return w(()=>!!m())()?"Copied":n.label},get"aria-pressed"(){return i!==void 0?l():void 0},onClick:()=>e.onAction(n.id),get children(){return r(c,{get when(){return m()},get fallback(){return r(c,{get when(){return n.Icon},get fallback(){return(()=>{var f=me();return g(f,()=>n.label),f})()},children:f=>{const p=f();return r(p,{get class(){return h("size-3.5",l()&&"fill-current")}})}})},get children(){return r(oe,{class:"size-3.5 text-emerald-400"})}})}}),v=()=>r(c,{get when(){return n.Icon},get fallback(){return s()},get children(){return r(N,{get content(){return a()},get children(){return s()}})}});return r(c,{when:i!==void 0,get fallback(){return v()},get children(){return(()=>{const f=()=>e.activeFeedback===void 0||e.activeFeedback===i;return(()=>{var p=fe(),U=p.firstChild;return g(U,v),x(b=>{var M=f()?void 0:"",T=h("grid transition-[grid-template-columns,opacity] duration-300 ease-out",f()?"grid-cols-[1fr] opacity-100":"grid-cols-[0fr] opacity-0");return M!==b.e&&k(p,"data-feedback-collapsed",b.e=M),T!==b.t&&j(p,b.t=T),b},{e:void 0,t:void 0}),p})()})()}})}})}})}function ze(e){const t=[];for(const n of e){if(n.type==="file"){const a=t[t.length-1];if(a?.kind==="files"){t[t.length-1]={kind:"files",parts:[...a.parts,n]};continue}t.push({kind:"files",parts:[n]});continue}if(n.type==="source"){const a=t[t.length-1];if(a?.kind==="sources"){t[t.length-1]={kind:"sources",parts:[...a.parts,n]};continue}t.push({kind:"sources",parts:[n]});continue}t.push({kind:"single",part:n})}return t}function Ie(e){if(e.index!==void 0)return e.index;if(!e.url)return e.title||"Source"}function Me(e){return e.title||e.url||"Source"}function I(e,t){return e.kind===t?e:!1}function y(e,t){return e.type===t?e:!1}function Te(e){const t=D(()=>ze(e.parts));return[r(c,{get when(){return e.beforeBody},get children(){return e.beforeBody}}),r(E,{get each(){return t()},children:n=>r(F,{fallback:null,get children(){return[r(o,{get when(){return I(n(),"files")},children:a=>r(W,{variant:"grid",get class(){return e.isUser?"mb-2 ml-auto":"mb-2"},get children(){return r(z,{get each(){return a().parts},children:i=>r(X,{get data(){return i.attachment},get children(){return r(Y,{get children(){return[r(Z,{class:"block size-full",get children(){return[r(ee,{}),r(re,{})]}}),r(te,{get children(){return r(c,{get when(){return w(()=>ne(i.attachment)==="image"&&i.attachment.type==="file")()&&i.attachment.url},get fallback(){return[(()=>{var l=ve();return g(l,()=>O(i.attachment)),l})(),r(c,{get when(){return i.attachment.mediaType},get children(){var l=be();return g(l,()=>i.attachment.mediaType),l}})]},get children(){var l=pe();return x(d=>{var m=O(i.attachment),s=i.attachment.url;return m!==d.e&&k(l,"alt",d.e=m),s!==d.t&&k(l,"src",d.t=s),d},{e:void 0,t:void 0}),l}})}})]}})}})})}})}),r(o,{get when(){return I(n(),"sources")},children:a=>r(ae,{part:"citations",get class(){return e.isUser?"justify-end":void 0},get children(){return r(z,{get each(){return a().parts},children:i=>r(ie,{get href(){return i.source.url},get children(){return[r(le,{get label(){return Ie(i.source)}}),r(se,{get title(){return Me(i.source)},get description(){return i.source.snippet??""}})]}})})}})}),r(o,{get when(){return I(n(),"single")},children:a=>{const i=()=>a().part,l=()=>y(i(),"reasoning"),d=()=>{const s=l();return s!==!1&&s.text===""},m=()=>{const s=l();return s!==!1&&s.text!==""&&s};return r(F,{fallback:null,get children(){return[r(o,{get when(){return y(i(),"text")},children:s=>r(ye,{part:"bubble content",get markdown(){return e.markdown},get class(){return e.isUser?"bg-muted max-w-[85%] rounded-2xl px-4 py-2":"bg-transparent p-0"},get children(){return s().text}})}),r(o,{get when(){return d()},children:null}),r(o,{get when(){return m()},children:s=>{const v=()=>e.reasoningMode??"full";return r(F,{fallback:null,get children(){return[r(o,{get when(){return v()==="full"},get children(){return r($,{class:"mb-2 w-full",get isStreaming(){return e.isStreaming},get defaultOpen(){return e.reasoningDefaultOpen},get openOnStream(){return e.reasoningDefaultOpen},get children(){return[r(G,{get children(){return s().label??"Reasoning"}}),r(J,{markdown:!0,get children(){return s().text}})]}})}}),r(o,{get when(){return w(()=>v()==="compact")()&&e.isStreaming},get children(){return r(K,{variant:"text-shimmer",get text(){return s().label??"Reasoning"},class:"mb-2"})}})]}})}}),r(o,{get when(){return y(i(),"tool")},children:s=>r(V,{get toolPart(){return s().tool},class:"mb-2 w-full"})}),r(o,{get when(){return y(i(),"card")},children:s=>r(ce,{get envelope(){return s().envelope},get types(){return e.cardTypes},get schemas(){return e.cardSchemas},get hostElement(){return e.cardHostElement}})})]}})}})]}})}),r(c,{get when(){var n;return(((n=e.actions)==null?void 0:n.length)??0)>0},get children(){return r(Fe,{get actions(){return e.actions},get reveal(){return e.actionsReveal==="hover"?"hover":"always"},get activeFeedback(){return e.activeFeedback},get copied(){return e.copied},onAction:n=>{var a;return(a=e.onAction)==null?void 0:a.call(e,n)}})}}),r(c,{get when(){return e.afterBody},get children(){return e.afterBody}})]}L(["click"]);export{Te as M,we as a,xe as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as s}from"./define-By-uL588.js";var e=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],m=a=>r(o,s(a,{name:"MessageCircle",iconNode:e})),i=m;export{i as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./Icon-DObhsRtm.js";import{c as o,q as r}from"./define-By-uL588.js";var m=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],s=a=>o(e,r(a,{name:"MessageSquare",iconNode:m})),i=s;export{i as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as i}from"./Icon-
|
|
1
|
+
import{I as i}from"./Icon-DObhsRtm.js";import{c as n,q as y}from"./define-By-uL588.js";var o=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],a=e=>n(i,y(e,{name:"Maximize2",iconNode:o})),l=a,m=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],p=e=>n(i,y(e,{name:"Minimize2",iconNode:m})),x=p;export{l as a,x as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as y,c as n,q as k,m as O,F as h,g as R,i as s,S as p,a as f,d as x,b as B,t as u,e as S}from"./define-
|
|
1
|
+
import{s as y,c as n,q as k,m as O,F as h,g as R,i as s,S as p,a as f,d as x,b as B,t as u,e as S}from"./define-By-uL588.js";import{c as v}from"./cn-DN5AWfiS.js";import{c as j,D as q,a as z,d as D}from"./dropdown-wZVeJOMd.js";import{B as F}from"./button-DkuOnGLy.js";var $=u('<svg width=12 height=12 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),A=u('<span class="text-caption text-muted-foreground">'),E=u('<div class="flex flex-col"><span>'),J=u("<div class=pl-2>"),P=u('<div><button type=button class="flex w-full items-center justify-between rounded-md px-2 py-1.5 text-body outline-none transition-colors hover:bg-muted focus:bg-muted">');const C=o=>(()=>{var e=$();return f(()=>x(e,"class",o.class)),e})();function b(o){const e=()=>o.model.description??o.model.provider,c=()=>o.model.id===o.currentModelId;return n(D,{get checked(){return c()},onSelect:()=>{o.onModelChange(o.model.id),o.onClose()},get children(){var d=E(),a=d.firstChild;return s(a,()=>o.model.name),s(d,n(p,{get when(){return e()},get children(){var i=A();return s(i,e),i}}),null),f(()=>B(a,v("text-body",c()&&"font-medium text-foreground"))),d}})}function _(o){const[e]=y(o,["models","currentModelId","onModelChange","class","defaultOpen","disabled","controllerRef"]),c=()=>e.models.find(r=>r.id===e.currentModelId);let d;const a=()=>d?.setOpen(!1),i=()=>e.models.filter(r=>!r.group),w=()=>{const r=[],t=new Map;for(const l of e.models)l.group&&(t.has(l.group)||(t.set(l.group,[]),r.push(l.group)),t.get(l.group).push(l));return r.map(l=>({name:l,models:t.get(l)}))};return n(p,{get when(){return e.models.length>1},get children(){return n(j,{get defaultOpen(){return e.defaultOpen},get disabled(){return e.disabled},controllerRef:r=>{var t;d=r,(t=e.controllerRef)==null||t.call(e,r)},get children(){return[n(q,{as:r=>n(F,k({variant:"ghost",size:"sm",get class(){return v("gap-1 text-meta text-muted-foreground",e.class)}},r,{get children(){return[O(()=>{var t;return((t=c())==null?void 0:t.name)??e.currentModelId}),n(C,{})]}}))}),n(z,{get children(){return[n(h,{get each(){return i()},children:r=>n(b,{model:r,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})}),n(h,{get each(){return w()},children:r=>{const[t,l]=R(!1);return(()=>{var m=P(),g=m.firstChild;return g.$$click=()=>l(!t()),s(g,()=>r.name,null),s(g,n(C,{get class(){return v("transition-transform",t()&&"rotate-180")}}),null),s(m,n(p,{get when(){return t()},get children(){var M=J();return s(M,n(h,{get each(){return r.models},children:I=>n(b,{model:I,get currentModelId(){return e.currentModelId},get onModelChange(){return e.onModelChange},onClose:a})})),M}}),null),f(()=>x(g,"aria-expanded",t())),m})()}})]}})]}})}})}S(["click"]);export{_ as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as It,c as jt,q as Xt,D as _t,g as tt,j as ut,h as dt}from"./define-CGGX-7Vg.js";const Yt=["top","right","bottom","left"],X=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,X(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(q(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=q(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=q(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=_(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=X(d[g],N),Q=X(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=_(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=q(i),w=M(s),x=q(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,qt)=>H+qt,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=_(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(q(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,I=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return I(e.transform)||I(e.translate)||I(e.scale)||I(e.rotate)||I(e.perspective)||!xt()&&(I(e.backdropFilter)||I(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:j(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=j(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=X(m.right,a),l=X(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=j(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=j(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,X(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?j(t):null;a&&y();function y(){const g=j(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=It(t,["as"]);return typeof e.as=="function"?e.as(n):jt(_t,Xt({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function qe(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function Ie(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,Ie as a,Ne as c,qe as u};
|
|
1
|
+
import{s as It,c as jt,q as Xt,D as _t,g as tt,j as ut,h as dt}from"./define-By-uL588.js";const Yt=["top","right","bottom","left"],X=Math.min,$=Math.max,ot=Math.round,it=Math.floor,A=t=>({x:t,y:t}),Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,n){return $(t,X(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function ht(t){return t==="y"?"height":"width"}function M(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pt(t){return Et(M(t))}function Gt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=pt(t),c=ht(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(r=rt(r)),[r,rt(r)]}function Kt(t){const e=rt(t);return[gt(t),e,gt(e)]}function gt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],Ot=["right","left"],Ut=["top","bottom"],Qt=["bottom","top"];function Zt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ot:Lt:e?Lt:Ot;case"left":case"right":return e?Ut:Qt;default:return[]}}function te(t,e,n,o){const i=et(t);let c=Zt(q(t),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),e&&(c=c.concat(c.map(gt)))),c}function rt(t){const e=q(t);return Jt[e]+t.slice(e.length)}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function ct(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Dt(t,e,n){let{reference:o,floating:i}=t;const c=M(e),r=pt(e),s=ht(r),a=q(e),l=c==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(et(e)){case"start":f[r]-=m*(n&&l?-1:1);break;case"end":f[r]+=m*(n&&l?-1:1);break}return f}async function ne(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:c,rects:r,elements:s,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=_(e,t),h=Tt(f),p=s[m?d==="floating"?"reference":"floating":d],y=ct(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(p)))==null||n?p:p.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:a})),g=d==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,w=await(c.getOffsetParent==null?void 0:c.getOffsetParent(s.floating)),x=await(c.isElement==null?void 0:c.isElement(w))?await(c.getScale==null?void 0:c.getScale(w))||{x:1,y:1}:{x:1,y:1},v=ct(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:a}):g);return{top:(y.top-v.top+h.top)/x.y,bottom:(v.bottom-y.bottom+h.bottom)/x.y,left:(y.left-v.left+h.left)/x.x,right:(v.right-y.right+h.right)/x.x}}const oe=50,ie=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,s=r.detectOverflow?r:{...r,detectOverflow:ne},a=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Dt(l,o,a),m=o,f=0;const h={};for(let p=0;p<c.length;p++){const y=c[p];if(!y)continue;const{name:g,fn:w}=y,{x,y:v,data:E,reset:b}=await w({x:u,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});u=x??u,d=v??d,h[g]={...h[g],...E},b&&f<oe&&(f++,typeof b=="object"&&(b.placement&&(m=b.placement),b.rects&&(l=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:u,y:d}=Dt(l,m,a)),p=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:h}},re=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:c,platform:r,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=_(t,e)||{};if(l==null)return{};const d=Tt(u),m={x:n,y:o},f=pt(i),h=ht(f),p=await r.getDimensions(l),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=c.reference[h]+c.reference[f]-m[f]-c.floating[h],E=m[f]-c.reference[f],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l));let B=b?b[x]:0;(!B||!await(r.isElement==null?void 0:r.isElement(b)))&&(B=s.floating[x]||c.floating[h]);const U=v/2-E/2,N=B/2-p[h]/2-1,S=X(d[g],N),Q=X(d[w],N),V=S,Z=B-p[h]-Q,R=B/2-p[h]/2+U,z=mt(V,R,Z),k=!a.arrow&&et(i)!=null&&R!==z&&c.reference[h]/2-(R<V?S:Q)-p[h]/2<0,L=k?R<V?R-V:R-Z:0;return{[f]:m[f]+L,data:{[f]:z,centerOffset:R-z-L,...k&&{alignmentOffset:L}},reset:k}}}),ce=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...y}=_(t,e);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const g=q(i),w=M(s),x=q(s)===s,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=m||(x||!p?[rt(s)]:Kt(s)),b=h!=="none";!m&&b&&E.push(...te(s,p,h,v));const B=[s,...E],U=await a.detectOverflow(e,y),N=[];let S=((o=c.flip)==null?void 0:o.overflows)||[];if(u&&N.push(U[g]),d){const R=Gt(i,r,v);N.push(U[R[0]],U[R[1]])}if(S=[...S,{placement:i,overflows:N}],!N.every(R=>R<=0)){var Q,V;const R=(((Q=c.flip)==null?void 0:Q.index)||0)+1,z=B[R];if(z&&(!(d==="alignment"&&w!==M(z))||S.every(L=>M(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:R,overflows:S},reset:{placement:z}};let k=(V=S.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(f){case"bestFit":{var Z;const L=(Z=S.filter(P=>{if(b){const H=M(P.placement);return H===w||H==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(H=>H>0).reduce((H,qt)=>H+qt,0)]).sort((P,H)=>P[1]-H[1])[0])==null?void 0:Z[0];L&&(k=L);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ct(t){return Yt.some(e=>t[e]>=0)}const se=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...c}=_(t,e);switch(i){case"referenceHidden":{const r=await o.detectOverflow(e,{...c,elementContext:"reference"}),s=At(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ct(s)}}}case"escaped":{const r=await o.detectOverflow(e,{...c,altBoundary:!0}),s=At(r,n.floating);return{data:{escapedOffsets:s,escaped:Ct(s)}}}default:return{}}}}},le=new Set(["left","top"]);async function ae(t,e){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),s=et(n),a=M(n)==="y",l=le.has(r)?-1:1,u=c&&a?-1:1,d=_(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(f=s==="end"?h*-1:h),a?{x:f*u,y:m*l}:{x:m*l,y:f*u}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:c,placement:r,middlewareData:s}=e,a=await ae(e,t);return r===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:c+a.y,data:{...a,placement:r}}}}},ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:c}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:w,y:x}=g;return{x:w,y:x}}},...l}=_(t,e),u={x:n,y:o},d=await c.detectOverflow(e,l),m=M(q(i)),f=Et(m);let h=u[f],p=u[m];if(r){const g=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=h+d[g],v=h-d[w];h=mt(x,h,v)}if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=p+d[g],v=p-d[w];p=mt(x,p,v)}const y=a.fn({...e,[f]:h,[m]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[f]:r,[m]:s}}}}}};function st(){return typeof window<"u"}function Y(t){return St(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(St(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function St(t){return st()?t instanceof Node||t instanceof O(t).Node:!1}function T(t){return st()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return st()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function kt(t){return!st()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function de(t){return/^(table|td|th)$/.test(Y(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const me=/transform|translate|scale|rotate|perspective|filter/,he=/paint|layout|strict|content/,I=t=>!!t&&t!=="none";let yt;function wt(t){const e=T(t)?D(t):t;return I(e.transform)||I(e.translate)||I(e.scale)||I(e.rotate)||I(e.perspective)||!xt()&&(I(e.backdropFilter)||I(e.filter))||me.test(e.willChange||"")||he.test(e.contain||"")}function pe(t){let e=W(t);for(;F(e)&&!J(e);){if(wt(e))return e;if(lt(e))return null;e=W(e)}return null}function xt(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function J(t){return/^(html|body|#document)$/.test(Y(t))}function D(t){return O(t).getComputedStyle(t)}function at(t){return T(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||C(t);return kt(e)?e.host:e}function Ft(t){const e=W(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&nt(e)?e:Ft(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ft(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),r=O(i);if(c){const s=vt(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],s&&n?G(s):[])}else return e.concat(i,G(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pt(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),c=i?t.offsetWidth:n,r=i?t.offsetHeight:o,s=ot(n)!==c||ot(o)!==r;return s&&(n=c,o=r),{width:n,height:o,$:s}}function bt(t){return T(t)?t:t.contextElement}function K(t){const e=bt(t);if(!F(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:c}=Pt(e);let r=(c?ot(n.width):n.width)/o,s=(c?ot(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!s||!Number.isFinite(s))&&(s=1),{x:r,y:s}}const ge=A(0);function Ht(t){const e=O(t);return!xt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==O(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=bt(t);let r=A(1);e&&(o?T(o)&&(r=K(o)):r=K(t));const s=ye(c,n,o)?Ht(c):A(0);let a=(i.left+s.x)/r.x,l=(i.top+s.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(c){const m=O(c),f=o&&T(o)?O(o):o;let h=m,p=vt(h);for(;p&&o&&f!==h;){const y=K(p),g=p.getBoundingClientRect(),w=D(p),x=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*y.y;a*=y.x,l*=y.y,u*=y.x,d*=y.y,a+=x,l+=v,h=O(p),p=vt(h)}}return ct({width:u,height:d,x:a,y:l})}function ft(t,e){const n=at(t).scrollLeft;return e?e.left+n:j(C(t)).left+n}function Mt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ft(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function we(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",r=C(o),s=e?lt(e.floating):!1;if(o===r||s&&c)return n;let a={scrollLeft:0,scrollTop:0},l=A(1);const u=A(0),d=F(o);if((d||!d&&!c)&&((Y(o)!=="body"||nt(r))&&(a=at(o)),d)){const f=j(o);l=K(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const m=r&&!d&&!c?Mt(r,a):A(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+m.x,y:n.y*l.y-a.scrollTop*l.y+u.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){const e=C(t),n=at(t),o=t.ownerDocument.body,i=$(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),c=$(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ft(t);const s=-n.scrollTop;return D(o).direction==="rtl"&&(r+=$(e.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:s}}const Wt=25;function be(t,e){const n=O(t),o=C(t),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,s=0,a=0;if(i){c=i.width,r=i.height;const u=xt();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const l=ft(o);if(l<=0){const u=o.ownerDocument,d=u.body,m=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-d.clientWidth-f);h<=Wt&&(c-=h)}else l<=Wt&&(c+=l);return{width:c,height:r,x:s,y:a}}function Re(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=F(t)?K(t):A(1),r=t.clientWidth*c.x,s=t.clientHeight*c.y,a=i*c.x,l=o*c.y;return{width:r,height:s,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=be(t,n);else if(e==="document")o=ve(C(t));else if(T(e))o=Re(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ct(o)}function Nt(t,e){const n=W(t);return n===e||!T(n)||J(n)?!1:D(n).position==="fixed"||Nt(n,e)}function Ee(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(s=>T(s)&&Y(s)!=="body"),i=null;const c=D(t).position==="fixed";let r=c?W(t):t;for(;T(r)&&!J(r);){const s=D(r),a=wt(r);!a&&s.position==="fixed"&&(i=null),(c?!a&&!i:!a&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||nt(r)&&!a&&Nt(t,r))?o=o.filter(l=>l!==r):i=s,r=W(r)}return e.set(t,o),o}function Le(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const c=[...n==="clippingAncestors"?lt(e)?[]:Ee(e,this._c):[].concat(n),o],r=Bt(e,c[0],i);let s=r.top,a=r.right,l=r.bottom,u=r.left;for(let d=1;d<c.length;d++){const m=Bt(e,c[d],i);s=$(m.top,s),a=X(m.right,a),l=X(m.bottom,l),u=$(m.left,u)}return{width:a-u,height:l-s,x:u,y:s}}function Oe(t){const{width:e,height:n}=Pt(t);return{width:e,height:n}}function Te(t,e,n){const o=F(e),i=C(e),c=n==="fixed",r=j(t,!0,c,e);let s={scrollLeft:0,scrollTop:0};const a=A(0);function l(){a.x=ft(i)}if(o||!o&&!c)if((Y(e)!=="body"||nt(i))&&(s=at(e)),o){const f=j(e,!0,c,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&l();c&&!o&&i&&l();const u=i&&!o&&!c?Mt(i,s):A(0),d=r.left+s.scrollLeft-a.x-u.x,m=r.top+s.scrollTop-a.y-u.y;return{x:d,y:m,width:r.width,height:r.height}}function Rt(t){return D(t).position==="static"}function Vt(t,e){if(!F(t)||D(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return C(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=O(t);if(lt(t))return n;if(!F(t)){let i=W(t);for(;i&&!J(i);){if(T(i)&&!Rt(i))return i;i=W(i)}return n}let o=Vt(t,e);for(;o&&de(o)&&Rt(o);)o=Vt(o,e);return o&&J(o)&&Rt(o)&&!wt(o)?n:o||pe(t)||n}const De=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ae(t){return D(t).direction==="rtl"}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:we,getDocumentElement:C,getClippingRect:Le,getOffsetParent:zt,getElementRects:De,getClientRects:xe,getDimensions:Oe,getScale:K,isElement:T,isRTL:Ae};function $t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,o;const i=C(t);function c(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function r(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),c();const l=t.getBoundingClientRect(),{left:u,top:d,width:m,height:f}=l;if(s||e(),!m||!f)return;const h=it(d),p=it(i.clientWidth-(u+m)),y=it(i.clientHeight-(d+f)),g=it(u),w={rootMargin:-h+"px "+-p+"px "+-y+"px "+-g+"px",threshold:$(0,X(1,a))||1};let x=!0;function v(E){const b=E[0].intersectionRatio;if(b!==a){if(!x)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!$t(l,t.getBoundingClientRect())&&r(),x=!1}try{n=new IntersectionObserver(v,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,w)}n.observe(t)}return r(!0),c}function ke(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=bt(t),u=i||c?[...l?G(l):[],...e?G(e):[]]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),c&&g.addEventListener("resize",n)});const d=l&&s?Se(l,n):null;let m=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===l&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),l&&!a&&f.observe(l),e&&f.observe(e));let h,p=a?j(t):null;a&&y();function y(){const g=j(t);p&&!$t(p,g)&&n(),p=g,h=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),c&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const Fe=fe,Pe=ue,He=ce,Me=se,We=re,Be=(t,e,n)=>{const o=new Map,i={platform:Ce,...n},c={...i.platform,_c:o};return ie(t,e,{...i,platform:c})};function Ne(t){const[e,n]=tt(t()),[o,i]=tt(t()?"open":"closed");let c,r=0;const s=a=>{c=a};return ut(a=>{const l=t();if(l)r++,n(!0),i("open");else if(a){i("closed");const u=c,d=u&&(()=>{const h=getComputedStyle(u);return h.animationName!=="none"&&parseFloat(h.animationDuration||"0")>0})();if(!u||!d){const h=++r;return queueMicrotask(()=>{h===r&&n(!1)}),l}const m=u,f=h=>{h.target===m&&(m.removeEventListener("animationend",f),n(!1))};m.addEventListener("animationend",f),dt(()=>m.removeEventListener("animationend",f))}return l}),{present:e,state:o,setRef:s}}function Ve(t){const[e,n]=It(t,["as"]);return typeof e.as=="function"?e.as(n):jt(_t,Xt({get component(){return e.as??"span"}},n))}function ze(t){let e=t;for(;e;){if(e instanceof Element&&e.closest("[inert]"))return!0;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}return!1}function $e(t,e){if(typeof MutationObserver!="function")return()=>{};let n=!1;const o=()=>t.isConnected&&!ze(t);let i=o();const c=()=>{if(!n){if(o()){i=!0;return}i&&(n=!0,r.disconnect(),e())}},r=new MutationObserver(c),s=new Set;typeof document<"u"&&s.add(document);const a=t.getRootNode();a&&s.add(a);for(const l of s)try{r.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["inert"]})}catch{}return()=>r.disconnect()}function qe(t,e,n={}){const[o,i]=tt({x:0,y:0,placement:n.placement??"bottom"}),[c,r]=tt({}),[s,a]=tt(!1);return ut(()=>{const l=t(),u=e();if(!l||!u)return;const d=()=>{var p;const y=[Fe(n.gutter??8),He(),Pe({padding:8})],g=(p=n.arrowEl)==null?void 0:p.call(n);g&&y.push(We({element:g})),y.push(Me()),Be(l,u,{placement:n.placement??"bottom",strategy:"fixed",middleware:y}).then(({x:w,y:x,placement:v,middlewareData:E})=>{var b;i({x:w,y:x,placement:v}),E.arrow&&r({x:E.arrow.x,y:E.arrow.y}),a(!!((b=E.hide)!=null&&b.referenceHidden))})},m=ke(l,u,d);let f;if(typeof ResizeObserver=="function"&&l instanceof Element){f=new ResizeObserver(d),f.observe(l);for(const p of G(l))p instanceof Element&&f.observe(p)}const h=n.onDisconnect?$e(l,n.onDisconnect):void 0;dt(()=>{m(),f?.disconnect(),h?.()})}),{pos:o,arrowPos:c,hidden:s}}function Ie(t){ut(()=>{if(!t.enabled())return;const e=i=>{i.key==="Escape"&&t.onDismiss("escape")},n=i=>{const c=i.target;t.refs().some(r=>r&&r.contains(c))||t.onDismiss("outside")},o=document;o.addEventListener("keydown",e),o.addEventListener("pointerdown",n,!0),dt(()=>{o.removeEventListener("keydown",e),o.removeEventListener("pointerdown",n,!0)})})}export{Ve as A,Ie as a,Ne as c,qe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as t}from"./Icon-
|
|
1
|
+
import{I as t}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],o=a=>r(t,e(a,{name:"PanelRight",iconNode:i})),h=o;export{h as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./Icon-
|
|
1
|
+
import{I as e}from"./Icon-DObhsRtm.js";import{c,q as r}from"./define-By-uL588.js";var m=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],o=a=>c(e,r(a,{name:"Globe",iconNode:m})),i=o,p=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],y=a=>c(e,r(a,{name:"Image",iconNode:p})),t=y,l=[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]],d=a=>c(e,r(a,{name:"Paperclip",iconNode:l})),h=d;export{i as g,t as i,h as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as a}from"./Icon-DObhsRtm.js";import{c as p,q as r}from"./define-By-uL588.js";var e=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],m=o=>p(a,r(o,{name:"Play",iconNode:e})),s=m;export{s as p};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ConversationSummary } from '../types.js';
|
|
2
|
+
import { ChatMessage } from '../elements/chat-types.js';
|
|
3
|
+
export interface ConversationStore {
|
|
4
|
+
list(): Promise<ConversationSummary[]>;
|
|
5
|
+
load(id: string): Promise<ChatMessage[]>;
|
|
6
|
+
save(id: string, messages: ChatMessage[]): Promise<void>;
|
|
7
|
+
/** OPTIONAL — unread indicators (owner round, 2026-08-26). Persist
|
|
8
|
+
* `ConversationSummary.lastReadAt` (that field's own doc has the exact
|
|
9
|
+
* shape) for `id`, called by `ChatThread` whenever that conversation
|
|
10
|
+
* counts as "seen": it's the active conversation, the chat view (not the
|
|
11
|
+
* list) is showing, and the host is open — on the select/restore
|
|
12
|
+
* transition into that state AND on every new message arriving while it
|
|
13
|
+
* holds (see `ChatThread`'s `hostOpen` prop doc for the third leg, which
|
|
14
|
+
* `ChatThread` cannot know on its own).
|
|
15
|
+
*
|
|
16
|
+
* This is the concept's OPT-IN switch, not a nice-to-have: omit it and no
|
|
17
|
+
* summary this store returns ever gets a `lastReadAt`, so every unread
|
|
18
|
+
* computation reads "not unread" (that field's absent-means-not-unread
|
|
19
|
+
* default) for every conversation, always. That is a DELIBERATE decide-
|
|
20
|
+
* loudly default, not a gap — a store that never implements `markRead`
|
|
21
|
+
* is read as never supporting the concept at all, and the UI goes quiet
|
|
22
|
+
* about it rather than guessing "probably unread" from a comparison it
|
|
23
|
+
* has no real signal for. `localStorageStore` implements it below.
|
|
24
|
+
* `fetchStore` deliberately does NOT (see its own doc) — it passes
|
|
25
|
+
* through whatever `lastReadAt` the backend's own summaries carry, same
|
|
26
|
+
* as every other field on `ConversationSummary`, rather than assuming a
|
|
27
|
+
* mark-read endpoint the recast contract never defined. */
|
|
28
|
+
markRead?(id: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare const LEGACY_THREAD_MIGRATED_TITLE = "Conversation 1";
|
|
31
|
+
/** Newest-first ordering over `updatedAt`; rows with a missing or unparsable
|
|
32
|
+
* timestamp sort last (stable, so ties keep declaration order). The ONE
|
|
33
|
+
* recency rule — the list panel, ChatThread's restore pick, and the home
|
|
34
|
+
* screen's recent card all sort with this (issue #335). */
|
|
35
|
+
export declare function byRecency(a: Pick<ConversationSummary, 'updatedAt'>, b: Pick<ConversationSummary, 'updatedAt'>): number;
|
|
36
|
+
export declare function localStorageStore(name: string, userId?: string): ConversationStore;
|
|
37
|
+
/** The recast of codegen.ts's emitHistorySetup endpoint behavior: the
|
|
38
|
+
* consumer's own conversation routes. GET {url} -> ConversationSummary[];
|
|
39
|
+
* GET {url}/:id -> ChatMessage[]; PUT {url}/:id with { messages } -> stored.
|
|
40
|
+
* x-kai-user-id carries userId on every request, matching the header
|
|
41
|
+
* codegen.ts already emits for the endpoint provider and the endpoint
|
|
42
|
+
* history persistence mode. Decide loudly: no request here catches its own
|
|
43
|
+
* rejection — a caller (ChatThread's lifecycle, Task 2) decides how to
|
|
44
|
+
* degrade, exactly as the spec's degradation section requires.
|
|
45
|
+
*
|
|
46
|
+
* No `markRead` (unread indicators, 2026-08-26): the recast contract above
|
|
47
|
+
* has no mark-read endpoint, and inventing a fourth request shape here
|
|
48
|
+
* would be this adapter deciding a backend behavior rather than passing one
|
|
49
|
+
* through. `list()`/`load()` already forward whatever `lastReadAt` the
|
|
50
|
+
* backend's own summaries carry, same as any other `ConversationSummary`
|
|
51
|
+
* field — a consumer who wants writes needs their own store (or their own
|
|
52
|
+
* endpoint plus a thin wrapper), same as any other capability this recast
|
|
53
|
+
* doesn't cover. */
|
|
54
|
+
export declare function fetchStore(url: string, userId?: string): ConversationStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as M,w as P,p as k,q,i as m,c as S,d as o,S as A,a as B,b as E,l as F,t as g}from"./define-
|
|
1
|
+
import{s as M,w as P,p as k,q,i as m,c as S,d as o,S as A,a as B,b as E,l as F,t as g}from"./define-By-uL588.js";import{c as h}from"./cn-DN5AWfiS.js";var I=g('<span class="text-xs text-muted-foreground">'),L=g('<div><div part=track role=progressbar aria-valuemin=0 class="h-1.5 w-full overflow-hidden rounded-full bg-surface-strong"><div part=fill>');const N={primary:"bg-primary",success:"bg-tool-green",warning:"bg-tool-amber",error:"bg-tool-red",info:"bg-tool-blue"};function T(p){const[r,x]=M(p,["value","max","label","tone","class","aria-label","aria-labelledby"]),i=P(),t=()=>r.max??100,s=()=>{const e=t();return e>0?Math.max(0,Math.min(r.value,e)):0},w=()=>{const e=t();return e>0?s()/e*100:0},y=()=>r.label?i:r["aria-labelledby"],C=()=>r.label||r["aria-labelledby"]?void 0:r["aria-label"]??"Progress";return(()=>{var e=L(),l=e.firstChild,n=l.firstChild;return k(e,q({get class(){return h("flex flex-col gap-1",r.class)}},x),!1,!0),m(e,S(A,{get when(){return r.label},get children(){var a=I();return o(a,"id",i),m(a,()=>r.label),a}}),l),B(a=>{var d=s(),u=t(),b=y(),v=C(),f=h("h-full rounded-full motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",N[r.tone??"primary"]),c=`${w()}%`;return d!==a.e&&o(l,"aria-valuenow",a.e=d),u!==a.t&&o(l,"aria-valuemax",a.t=u),b!==a.a&&o(l,"aria-labelledby",a.a=b),v!==a.o&&o(l,"aria-label",a.o=v),f!==a.i&&E(n,a.i=f),c!==a.n&&F(n,"width",a.n=c),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})()}export{T as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as w,c as t,S as a,q as u,i as c,m as x,t as p}from"./define-
|
|
1
|
+
import{s as w,c as t,S as a,q as u,i as c,m as x,t as p}from"./define-By-uL588.js";import{c as g}from"./cn-DN5AWfiS.js";import{B as o}from"./button-DkuOnGLy.js";import{r as b}from"./icon-CdcfRhYI.js";var y=p('<span class="min-w-0 flex-1">'),f=p('<span class="text-foreground/70 whitespace-pre-wrap">'),z=p('<span class="text-foreground font-medium whitespace-pre-wrap">');function k(i){const[r,s]=w(i,["children","variant","size","class","icon","highlight","block","list"]),h=()=>t(a,{get when(){return r.icon},get children(){return b(r.icon,{class:"size-3.5 shrink-0"})}}),d=()=>r.highlight!==void 0&&r.highlight.trim()!=="",n=()=>typeof r.children=="string"?r.children:"";return t(a,{get when(){return d()},get fallback(){return t(a,{get when(){return r.list},get fallback(){return t(a,{get when(){return r.block},get fallback(){return t(o,u({get variant(){return r.variant??"outline"},size:"lg",get class(){return g("rounded-full",r.class)}},s,{get children(){return[t(h,{}),x(()=>r.children)]}}))},get children(){return t(o,u({get variant(){return r.variant??"outline"},size:"md",get class(){return g("h-auto w-full cursor-pointer justify-start rounded-xl px-4 py-2.5","text-left text-sm leading-snug whitespace-normal text-pretty",r.class)}},s,{get children(){return r.children}}))}})},get children(){return t(o,u({get variant(){return r.variant??"ghost"},size:"md",get class(){return g("group h-auto w-full cursor-pointer items-center justify-start gap-2.5 rounded-xl px-3",r.size==="lg"?"py-3.5":"py-2.5","text-left text-sm leading-snug whitespace-normal text-pretty","hover:bg-accent",r.class)}},s,{get children(){return[t(h,{}),(()=>{var l=y();return c(l,()=>r.children),l})()]}}))}})},get children(){return t(a,{get when(){return n()},get fallback(){return t(o,u({get variant(){return r.variant??"ghost"},size:"sm",get class(){return g("w-full cursor-pointer justify-start rounded-xl py-2","hover:bg-accent",r.class)}},s,{get children(){return r.children}}))},get children(){return t(o,u({get variant(){return r.variant??"ghost"},size:"sm",get class(){return g("w-full cursor-pointer justify-start gap-0 rounded-xl py-2","hover:bg-accent",r.class)}},s,{get children(){return j(n(),r.highlight)}}))}})}})}function j(i,r){const s=r.trim(),h=i.toLowerCase(),d=s.toLowerCase(),n=h.indexOf(d);if(n===-1)return(()=>{var e=f();return c(e,i),e})();const l=i.substring(0,n),m=i.substring(n,n+d.length),v=i.substring(n+m.length);return[t(a,{when:l,get children(){var e=f();return c(e,l),e}}),(()=>{var e=z();return c(e,m),e})(),t(a,{when:v,get children(){var e=f();return c(e,v),e}})]}export{k as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as b,p as m,q as f,t as a,w,i as n,c as o,S as h,a as y,b as B,F as S}from"./define-
|
|
1
|
+
import{s as b,p as m,q as f,t as a,w,i as n,c as o,S as h,a as y,b as B,F as S}from"./define-By-uL588.js";import{c as g}from"./cn-DN5AWfiS.js";var q=a("<input>"),O=a("<div>"),R=a("<label>"),F=a('<span class="flex flex-col gap-0.5"><span></span><span class="text-xs font-normal text-muted-foreground">'),N=a("<span>");function x(i){const[e,d]=b(i,["class"]);return(()=>{var l=q();return m(l,f(d,{type:"radio",get class(){return g("kai-radio",e.class)}}),!1,!1),l})()}function P(i){const[e,d]=b(i,["options","value","name","disabled","label","onChange","onOptionBlur","itemClass","children","class"]),l=w(),C=()=>e.name??l;return(()=>{var u=O();return m(u,f(d,{role:"radiogroup",get"aria-label"(){return e.label},get class(){return g("divide-y divide-border overflow-hidden rounded-lg border border-border",e.class)}}),!1,!0),n(u,o(S,{get each(){return e.options},children:t=>{const c=()=>e.value===t.value,p=()=>!!(e.disabled||t.disabled);return(()=>{var s=R();return n(s,o(x,{get name(){return C()},get value(){return String(t.value)},get checked(){return c()},get disabled(){return p()},get class(){return t.description===void 0?void 0:"mt-0.5"},onChange:()=>{var r;return(r=e.onChange)==null?void 0:r.call(e,t.value,t)},onBlur:()=>{var r;return(r=e.onOptionBlur)==null?void 0:r.call(e)}}),null),n(s,o(h,{get when(){return e.children},get fallback(){return o(h,{get when(){return t.description!==void 0},get fallback(){return(()=>{var r=N();return n(r,()=>t.label),r})()},get children(){var r=F(),v=r.firstChild,k=v.nextSibling;return n(v,()=>t.label),n(k,()=>t.description),r}})},children:r=>r()(t,{checked:c(),disabled:p()})}),null),y(()=>B(s,g("flex cursor-pointer items-center gap-3 px-3 py-2.5 text-sm transition-colors",t.description!==void 0&&"items-start",c()?"bg-accent font-medium text-accent-foreground":"text-foreground hover:bg-muted/50",e.itemClass))),s})()}})),u})()}export{P as R,x as a};
|