@mycadet/web 0.12.8 → 0.12.9
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/dist/assets/{a2a-invite-S74k5mzP.js → a2a-invite-QwLkdzoC.js} +1 -1
- package/dist/assets/{about-page-DyXvah3b.js → about-page-B_JVAkzb.js} +1 -1
- package/dist/assets/{account-page-Bto5XueR.js → account-page-CogcrHfl.js} +1 -1
- package/dist/assets/{account-shell-CcrYy1Gi.js → account-shell-CaNt5YTy.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-6rMAmeGf.js → acp-run-detail-panel-CP2w6xWq.js} +1 -1
- package/dist/assets/{activation-list-route-DEc7Nydy.js → activation-list-route-DhFybN08.js} +1 -1
- package/dist/assets/{activity-redirect-page-Fj-SvRGq.js → activity-redirect-page-CXQh1ANc.js} +1 -1
- package/dist/assets/{activity-steps-panel-CPMerTsn.js → activity-steps-panel-B_e7fo5d.js} +1 -1
- package/dist/assets/{add-credits-modal-zPPHPAJC.js → add-credits-modal-9QAiKkzN.js} +1 -1
- package/dist/assets/add-credits-modal-Ix6EeRaW.js +1 -0
- package/dist/assets/{ai-page-DpOLL1Cf.js → ai-page-B2OQRNjs.js} +1 -1
- package/dist/assets/{all-chats-page-route-C-XHiLQy.js → all-chats-page-route-DyAsat0t.js} +1 -1
- package/dist/assets/{android-billing-handoff-DKLezn_S.js → android-billing-handoff-CNDHANI3.js} +1 -1
- package/dist/assets/{animated-stat-square-BU2cZ2yE.js → animated-stat-square-dwxhuRgk.js} +1 -1
- package/dist/assets/{api-key-screen-DjKTR4Wr.js → api-key-screen-sXJo9h2L.js} +1 -1
- package/dist/assets/{app-CGffgaON.js → app-BNxKtvfM.js} +33 -33
- package/dist/assets/{app-info-Dzir1MF3.js → app-info-BWhtZVwd.js} +1 -1
- package/dist/assets/{archive-redirect-page-B35h0qMl.js → archive-redirect-page-8VfIdYbY.js} +1 -1
- package/dist/assets/{assistant-handle-modal-CCjfVewp.js → assistant-handle-modal-BEF0aNRE.js} +1 -1
- package/dist/assets/{assistant-inbox-page-route-gDwC5zAt.js → assistant-inbox-page-route-C2cqOdmg.js} +1 -1
- package/dist/assets/{assistant-status-panel-B4KyLsgX.js → assistant-status-panel-DCxA9DDF.js} +1 -1
- package/dist/assets/auth-store-CDCjQtV1.js +1 -0
- package/dist/assets/{auth-welcome-screen-D3ES6d_K.js → auth-welcome-screen-EpKCTMv_.js} +1 -1
- package/dist/assets/avatar-bundled-components-DjgVURNE.js +1 -0
- package/dist/assets/{avatar-random-GdFF3KT1.js → avatar-random-BnJhjNyL.js} +1 -1
- package/dist/assets/{await-org-header-settled-B8OULI5x.js → await-org-header-settled-DIN659KU.js} +1 -1
- package/dist/assets/{background-task-detail-panel-D-gfV8cA.js → background-task-detail-panel-CK5CkHAh.js} +1 -1
- package/dist/assets/{billing-page-DpBwQzdt.js → billing-page-DxzuCWv_.js} +3 -3
- package/dist/assets/{billing-redirect-page-eAiiFN78.js → billing-redirect-page-3KVpziky.js} +1 -1
- package/dist/assets/{bookmarks-page-CSlXo0sR.js → bookmarks-page-DU4zQI88.js} +1 -1
- package/dist/assets/{bundle-confirm-page-Bcm9pKNZ.js → bundle-confirm-page-BF_TkeTV.js} +1 -1
- package/dist/assets/camera-capture-overlay-T0uYBvOu.js +1 -0
- package/dist/assets/{channel-transcript-panel-DPuZkTwm.js → channel-transcript-panel-B1TEFqiF.js} +1 -1
- package/dist/assets/{channels-page-route-Cny62l_j.js → channels-page-route-DeocXDqs.js} +1 -1
- package/dist/assets/{chat-info-panel-D17faG13.js → chat-info-panel-lH_eTIGQ.js} +1 -1
- package/dist/assets/{checkout-continuation-7dEznmik.js → checkout-continuation-syD1rPaq.js} +1 -1
- package/dist/assets/{checkout-page-p7LdgQze.js → checkout-page-CDxb2TKu.js} +1 -1
- package/dist/assets/checkout-return-target-Kr5OSzWN.js +1 -0
- package/dist/assets/{cloud-export-97vA7Pm2.js → cloud-export-BomC8LTr.js} +1 -1
- package/dist/assets/{cloud-loopback-page-D2BotkZe.js → cloud-loopback-page-CKanLlm2.js} +1 -1
- package/dist/assets/command-palette-B7s1-xLZ.js +1 -0
- package/dist/assets/{command-palette-BT_juy2T.js → command-palette-CCerSENn.js} +1 -1
- package/dist/assets/{command-palette-window-page-BEOnIIIB.js → command-palette-window-page-DB4W1uBp.js} +1 -1
- package/dist/assets/{community-page-DSFCzNlP.js → community-page-JCjpT273.js} +1 -1
- package/dist/assets/{companion-accent-BnQ_HHAs.js → companion-accent-DNqagkeK.js} +1 -1
- package/dist/assets/{companion-dock-zones-page-Cwk-m5lx.js → companion-dock-zones-page-B5FQh1TR.js} +1 -1
- package/dist/assets/{companion-layout-C8BAml92.js → companion-layout-BJ70ZoB6.js} +1 -1
- package/dist/assets/{companion-popover-9C2r1GyG.js → companion-popover-ojFFv5gc.js} +1 -1
- package/dist/assets/{companion-popover-page-Slqq_QRZ.js → companion-popover-page-CcjHgR5K.js} +1 -1
- package/dist/assets/{companion-surface-2FTY6hzz.js → companion-surface-BheNXy_6.js} +1 -1
- package/dist/assets/{companion-surface-page-BCDuCzpC.js → companion-surface-page-BxYp5tfL.js} +1 -1
- package/dist/assets/{companion-tour-entry-BdZ_ZZY5.js → companion-tour-entry-Cv7pdZrq.js} +1 -1
- package/dist/assets/{companion-watch-frame-page-BXLCktNV.js → companion-watch-frame-page-3M8uEp9f.js} +1 -1
- package/dist/assets/{connect-page-DqXNWB3e.js → connect-page-B3uUGMgH.js} +1 -1
- package/dist/assets/{consent-controls-VUQpPjpF.js → consent-controls-C5hiZrsf.js} +1 -1
- package/dist/assets/{contacts-gateway-M0SEA0Ls.js → contacts-gateway-FWhhciZa.js} +1 -1
- package/dist/assets/{contacts-page-route-ciiisSbk.js → contacts-page-route-GziPFmXf.js} +1 -1
- package/dist/assets/{copy-button-06ZBxF-g.js → copy-button-SNK3X3Q6.js} +1 -1
- package/dist/assets/{credential-entry-page-CZTFQmW3.js → credential-entry-page-SwWWNGX8.js} +1 -1
- package/dist/assets/{credentials-page-bcb6LbyX.js → credentials-page-DRfwESO-.js} +1 -1
- package/dist/assets/{csv-preview-B8vxTOAh.js → csv-preview-U7XwAhlX.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-C-53yyHV.js → danger-zone-redirect-page-BV0lGnl_.js} +1 -1
- package/dist/assets/{debug-page-2DthUX8Q.js → debug-page-DwtjfO0H.js} +1 -1
- package/dist/assets/deploy-dialogs-7b-AY3wa.js +1 -0
- package/dist/assets/{deploy-dialogs-CaZCOLcW.js → deploy-dialogs-DDe4zOdX.js} +1 -1
- package/dist/assets/{desktop-preview-content-Bx5_gQqm.js → desktop-preview-content-_pIEbVde.js} +2 -2
- package/dist/assets/{desktop-status-L9sA78zU.js → desktop-status-DmWWnzqE.js} +1 -1
- package/dist/assets/{desktop-viewer-Gsp9ciNF.js → desktop-viewer-B9Vcq1Ei.js} +1 -1
- package/dist/assets/{detail-card-DXYh92lS.js → detail-card-DF9nj6Gj.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-JQH92FSa.js → detail-panel-stop-button-D3b4nxcG.js} +1 -1
- package/dist/assets/{detail-primitives-PCZSBjkS.js → detail-primitives-LOD0kRZ4.js} +1 -1
- package/dist/assets/{developer-page-f8SdDLWI.js → developer-page-BQ5bGk-4.js} +1 -1
- package/dist/assets/{devices-redirect-page-rOcV02dL.js → devices-redirect-page-Bn2y0m1x.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BPYJcuF5.js → dictation-overlay-page-DPR2rDDh.js} +1 -1
- package/dist/assets/document-load-BTXflX5D.js +1 -0
- package/dist/assets/{document-load-Cx6SmMsX.js → document-load-BziXWGTc.js} +1 -1
- package/dist/assets/{document-viewer-page-buw3L7Qh.js → document-viewer-page-B-2c3m5R.js} +1 -1
- package/dist/assets/{emails-page-CRcIGJMH.js → emails-page-CgiQD0Sv.js} +1 -1
- package/dist/assets/{file-diff-view-BPGy665x.js → file-diff-view-8ciHw9A7.js} +1 -1
- package/dist/assets/{file-view-mode-BjICMrIT.js → file-view-mode-BjjBnpYU.js} +1 -1
- package/dist/assets/{general-page-CtS_CU7C.js → general-page-DIQRLvou.js} +1 -1
- package/dist/assets/{hatching-screen-SRp857Tl.js → hatching-screen-Dbp76r0P.js} +1 -1
- package/dist/assets/{hosting-screen-BBK1bOi2.js → hosting-screen-fTZt7kCM.js} +1 -1
- package/dist/assets/{identity-page-route-BjuOZBNC.js → identity-page-route-CHM3oI-k.js} +1 -1
- package/dist/assets/{inspect-page-yQXS977E.js → inspect-page-BHs6vilE.js} +3 -3
- package/dist/assets/{integrations-page-8saNghxG.js → integrations-page-CeK7nrkI.js} +1 -1
- package/dist/assets/{intelligence-layout-C4fUSmw1.js → intelligence-layout-UKSuU3yD.js} +1 -1
- package/dist/assets/{intelligence-layout-slots-store-CdCFMdty.js → intelligence-layout-slots-store-yq8xZ_lC.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-redirect-page-6vmXYM08.js → keyboard-shortcuts-redirect-page-BfgCJJ8W.js} +1 -1
- package/dist/assets/{latest-assistant-text-Dp8nFLYg.js → latest-assistant-text-BbUF-ZjG.js} +1 -1
- package/dist/assets/{library-detail-page-BHsng9gW.js → library-detail-page-DCVP6Thc.js} +1 -1
- package/dist/assets/{library-page-EGcuUr9r.js → library-page-DemxnENP.js} +1 -1
- package/dist/assets/{login-page-CjFFBEfP.js → login-page-DJCWMJPS.js} +1 -1
- package/dist/assets/{logout-page-CTk1D8H1.js → logout-page-rrrf5aYw.js} +1 -1
- package/dist/assets/{logs-layout-DcUsHX4i.js → logs-layout-CU-5OL3A.js} +1 -1
- package/dist/assets/{markdown-preview-BVK8h-Vm.js → markdown-preview-h2xJTbi7.js} +1 -1
- package/dist/assets/{media-preview-DMvBX4tR.js → media-preview-6Dw68M9L.js} +1 -1
- package/dist/assets/{memory-page-route-DmcTly3j.js → memory-page-route-BZYeOOeW.js} +1 -1
- package/dist/assets/{memory-router-playground-page-BKIKjicw.js → memory-router-playground-page-CsN1IIJA.js} +1 -1
- package/dist/assets/{message-files-panel-ffUSMnCt.js → message-files-panel-CNC5v1w7.js} +1 -1
- package/dist/assets/mutation-error-CAyH2x36.js +1 -0
- package/dist/assets/native-attachment-pickers-BjVoKEUQ.js +1 -0
- package/dist/assets/native-file-CYAEPXYN.js +1 -0
- package/dist/assets/{notifications-page-uL-24dgJ.js → notifications-page-B3Em-VQu.js} +1 -1
- package/dist/assets/{oauth-complete-page-CeSrrc5l.js → oauth-complete-page-BJObwKje.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-B2YWDBhK.js → oauth-popup-complete-page-dpJtFUH5.js} +1 -1
- package/dist/assets/paired-cloud-identity-D6ABqHK-.js +1 -0
- package/dist/assets/{pairing-page-BKpPzHgF.js → pairing-page-dZeno0_m.js} +1 -1
- package/dist/assets/password-reset-page-IPvSLWAz.js +1 -0
- package/dist/assets/{pdf-file-preview-yZHctfTY.js → pdf-file-preview-C68i9dU6.js} +1 -1
- package/dist/assets/{permission-guide-page-BiIbMRw2.js → permission-guide-page-BTU82Ybk.js} +1 -1
- package/dist/assets/{permission-setup-C3D0R4tU.js → permission-setup-DohBLdCl.js} +1 -1
- package/dist/assets/{personality-page-C9zAoDC4.js → personality-page-BIMzWgMh.js} +1 -1
- package/dist/assets/{personality-page-B0t7PCzh.js → personality-page-_k2z41Bt.js} +1 -1
- package/dist/assets/{personality-sliders-Cz11kvVy.js → personality-sliders-DGNY8Rnd.js} +1 -1
- package/dist/assets/{plans-page-Cyy_VAfs.js → plans-page-pq5hy60L.js} +1 -1
- package/dist/assets/{plugin-detail-page-MHjzhIjU.js → plugin-detail-page-BbA4_EQi.js} +1 -1
- package/dist/assets/{plugins-page-CGd4eA0h.js → plugins-page-DxdhU21Z.js} +1 -1
- package/dist/assets/plugins-surface-DQ6HNFGt.js +1 -0
- package/dist/assets/{preview-error-B_SkKxgl.js → preview-error-DhG_s3C0.js} +1 -1
- package/dist/assets/{privacy-page-BH7VrzNO.js → privacy-page-BqiHHg7j.js} +1 -1
- package/dist/assets/{privacy-screen-DRUImDBf.js → privacy-screen-Dq4eUoIO.js} +1 -1
- package/dist/assets/{profile-card-eeDPrAqN.js → profile-card-CkTa3Y8i.js} +1 -1
- package/dist/assets/{provider-callback-page-C25nZdj2.js → provider-callback-page-Bmu6iHxa.js} +1 -1
- package/dist/assets/{provider-key-DCXewaJg.js → provider-key-DBdqn0Gt.js} +1 -1
- package/dist/assets/{provider-signup-page-BFYxSU4D.js → provider-signup-page-JIh0XKV5.js} +1 -1
- package/dist/assets/{quick-input-page-BWyYCc6N.js → quick-input-page-ALtrRR05.js} +1 -1
- package/dist/assets/{research-mock-page-DT6p-Af5.js → research-mock-page-C8n5xPsy.js} +1 -1
- package/dist/assets/{research-onboarding-route-B3KTgEuk.js → research-onboarding-route-BgMvaYdY.js} +1 -1
- package/dist/assets/{review-terms-screen-CBbhXbba.js → review-terms-screen-CnIUYPfa.js} +1 -1
- package/dist/assets/routes-Ct3akvBN.js +1 -0
- package/dist/assets/{schedules-BklxG5oV.js → schedules-D8f5wsZc.js} +1 -1
- package/dist/assets/{schedules-page-D_2A6U2f.js → schedules-page-B8PnXfuh.js} +1 -1
- package/dist/assets/{security-redirect-page-424yJDDE.js → security-redirect-page-L5VVUkhf.js} +1 -1
- package/dist/assets/{select-assistant-screen-B2waFR5c.js → select-assistant-screen-Bm0waz2L.js} +1 -1
- package/dist/assets/{self-hosted-servers-Du7ejILs.js → self-hosted-servers-BxHLMpeP.js} +1 -1
- package/dist/assets/{service-form-controls-BzzepR1w.js → service-form-controls-BcaLg3mN.js} +1 -1
- package/dist/assets/{setting-row-Har-4ZuZ.js → setting-row-3-QGMKbV.js} +1 -1
- package/dist/assets/{settings-divider-fXUzEDBM.js → settings-divider-D1gYuSPt.js} +1 -1
- package/dist/assets/{settings-layout-Bh6Tfq82.js → settings-layout-Cuol1Jld.js} +1 -1
- package/dist/assets/share-feedback-modal-CdzyF0gl.js +1 -0
- package/dist/assets/{share-feedback-modal-q27kCbAf.js → share-feedback-modal-O62ToKHM.js} +1 -1
- package/dist/assets/{sidebar-tree-DpyD-Fdr.js → sidebar-tree-D1pphm3H.js} +1 -1
- package/dist/assets/{signup-page-B2QNQ-OW.js → signup-page-6gPB7H4i.js} +1 -1
- package/dist/assets/{signup-shell-BJfIr9N8.js → signup-shell-I1tsWrB2.js} +1 -1
- package/dist/assets/{skill-detail-page-DWc5Pj07.js → skill-detail-page-CaaPoNXG.js} +1 -1
- package/dist/assets/{skill-detail-panel-DOpFqxJk.js → skill-detail-panel-CVrIAGi1.js} +1 -1
- package/dist/assets/{skill-removal-dialog-B-Hb8zf4.js → skill-removal-dialog-DVzlADbq.js} +1 -1
- package/dist/assets/{skills-page-COVvjwYi.js → skills-page-BjmHcl-i.js} +1 -1
- package/dist/assets/{sounds-page-DB5YcVc4.js → sounds-page-DM_LZFsH.js} +1 -1
- package/dist/assets/{start-screen-FL2Ia1Ar.js → start-screen-Dh8Xc1ux.js} +1 -1
- package/dist/assets/{step-detail-header-CuTbSKtU.js → step-detail-header-C1U-HS14.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-BjXK4fmX.js → stt-language-picker-modal-BWPQXHbg.js} +1 -1
- package/dist/assets/{subagent-detail-panel-DLgSr_E8.js → subagent-detail-panel-BEHD2vOf.js} +1 -1
- package/dist/assets/{superpowers-page-CscgKzE0.js → superpowers-page-Civ1dred.js} +1 -1
- package/dist/assets/{system-events-page-CNdWB8DB.js → system-events-page-DQQD-yh4.js} +1 -1
- package/dist/assets/{system-events-redirect-page-CRcNF9hG.js → system-events-redirect-page-CMQWTWeS.js} +1 -1
- package/dist/assets/{tabular-grid-CejyLbWr.js → tabular-grid-Crdhci1a.js} +1 -1
- package/dist/assets/{teleport-gateway-client-CnEsY6jD.js → teleport-gateway-client-zRxDIHvy.js} +1 -1
- package/dist/assets/{text-preview-CNTf9DBr.js → text-preview-CCRT6NMb.js} +1 -1
- package/dist/assets/{theme-stage-page-CYKLJ4g7.js → theme-stage-page-BKDKhybd.js} +1 -1
- package/dist/assets/{tiptap-document-editor-B7WZaMjw.js → tiptap-document-editor-DMBoEpva.js} +1 -1
- package/dist/assets/{tool-detail-panel-DlHI8dvX.js → tool-detail-panel-BR7h2ROn.js} +1 -1
- package/dist/assets/tool-detail-panel-DCdX_SBO.js +1 -0
- package/dist/assets/{trait-cycle-row-BctewJVE.js → trait-cycle-row-Lgkm9R8c.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-jDoqH3zX.js → upgrade-cancel-page-DEIK5f2e.js} +1 -1
- package/dist/assets/{upgrade-success-page-CaUf2wkq.js → upgrade-success-page-Dt9lxhGP.js} +1 -1
- package/dist/assets/{usage-redirect-page-BAgziC1P.js → usage-redirect-page-BMvSf6Bj.js} +1 -1
- package/dist/assets/{use-app-delete-DeDK3zNm.js → use-app-delete-NTNPyRFw.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-Ku8Yexur.js → use-assistant-identity-details-20XTojNX.js} +1 -1
- package/dist/assets/{use-channel-trust-floors-Dw7093F3.js → use-channel-trust-floors-sx-Gm1Em.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-D-DceYdb.js → use-checkout-dismiss-refresh-C7kMkxS1.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-C9BhPjNd.js → use-edge-swipe-back-D92U2q-N.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-CaKGUrs_.js → use-hotkey-recorder-BRdHU8pS.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-DwZSXJdy.js → use-invite-link-dialog-CbFJAi4C.js} +1 -1
- package/dist/assets/{use-plugins-list-PsghpbJo.js → use-plugins-list-BQG0kv-t.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-oXJVLQ5r.js → use-return-to-short-circuit-Dqo3POFE.js} +1 -1
- package/dist/assets/{use-side-list-room-BPMo-0-m.js → use-side-list-room-BL6BAMEB.js} +1 -1
- package/dist/assets/{use-skill-actions-DdykFGoL.js → use-skill-actions-Ch-wHH29.js} +1 -1
- package/dist/assets/{use-skill-detail-files-Cx9IY9kI.js → use-skill-detail-files-Chj_ePZG.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-Dv49IKbZ.js +1 -0
- package/dist/assets/{voice-page-DUXZHnnu.js → voice-page-CcybrzXj.js} +1 -1
- package/dist/assets/{wake-detail-panel-qrpIcnpA.js → wake-detail-panel-BNA47SoV.js} +1 -1
- package/dist/assets/{weather-forecast-display-Bjrjg54J.js → weather-forecast-display-BGKTfbzy.js} +1 -1
- package/dist/assets/{welcome-screen-C-7GbST1.js → welcome-screen-nz_FAiGA.js} +1 -1
- package/dist/assets/{workflow-detail-panel-BAeI7O0P.js → workflow-detail-panel-DRoeaq6c.js} +1 -1
- package/dist/assets/{workspace-page-WKaE0JcI.js → workspace-page-ClGrsRBZ.js} +1 -1
- package/dist/assets/{xlsx-preview-HzWjwDAj.js → xlsx-preview-z2rPKBuW.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/add-credits-modal-DD_BJhmr.js +0 -1
- package/dist/assets/auth-store-BVApYFfc.js +0 -1
- package/dist/assets/avatar-bundled-components-Drkl7JyC.js +0 -1
- package/dist/assets/camera-capture-overlay-BF2ncbf2.js +0 -1
- package/dist/assets/checkout-return-target-CSJF-o8i.js +0 -1
- package/dist/assets/command-palette-2v-4uw_p.js +0 -1
- package/dist/assets/deploy-dialogs-BXmWQL7g.js +0 -1
- package/dist/assets/document-load-dMbILFST.js +0 -1
- package/dist/assets/mutation-error-oXzAul2s.js +0 -1
- package/dist/assets/native-attachment-pickers-D94Qe9-T.js +0 -1
- package/dist/assets/native-file-BAJbUfaG.js +0 -1
- package/dist/assets/paired-cloud-identity-B45tIpgK.js +0 -1
- package/dist/assets/password-reset-page-B9xxvNOh.js +0 -1
- package/dist/assets/plugins-surface-CxIHR2Dv.js +0 -1
- package/dist/assets/routes-D5cM5I_f.js +0 -1
- package/dist/assets/share-feedback-modal-B12QCt5f.js +0 -1
- package/dist/assets/tool-detail-panel-uk4Ie38C.js +0 -1
- package/dist/assets/use-supports-credentials-settings-CaBKQ60M.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,Gr as n,Kr as r,MS as i,QS as a,Xg as o,Zo as s,oC as c}from"./app-CGffgaON.js";import{t as l,x as u}from"./react-BJ4PZBJN.js";import{lt as d,w as f}from"./vendor-CezcraPH.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-Dwi7aA1Y.js";var v=e(u(),1),y=l();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:s(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(c,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=f();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:n}){let{t:r}=f(),{playing:i,play:a,stop:o}=C();return(0,y.jsx)(x,{label:r(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=i===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${r(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>n?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(t,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?r(`companionPopover.stopPreview`):r(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?o():a(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`;function D({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:a,attached:o=!1,className:c,style:l}){let{t:u}=f();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`w-max max-w-[640px] rounded-[22px]`,E,c),style:l,children:(0,y.jsx)(O,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!o&&`rounded-[20px] border border-white/10 bg-[#17181b] shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,c),style:l,children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(I,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(L,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(R,{popover:e,onAnswer:r,onOpenLink:a})})}function O({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=f(),a=e.kind===`approvals`?e.items[0]:void 0,o=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:s(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(H,{providerKey:e.providerKey}):null,(0,y.jsx)(N,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:k,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):o&&a!==void 0?a.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:o&&a!==void 0?(0,y.jsx)(P,{item:a,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(G,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var k=440,A=400;function j(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>M)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var M=48;function N({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=j(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function P({item:e,pill:n,onAnswer:r}){let{t:i}=f(),a=()=>r?.({kind:`deny`,itemId:e.id}),o=()=>r?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return n?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`negative`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(G,{tone:`primary`,onClick:o,children:i(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t,{variant:`dangerOutline`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(t,{variant:`primary`,onClick:o,children:i(`companionPopover.allow`)})]})}function F({title:e,icon:n,emphasis:r=!1,onClose:i}){let{t:a}=f();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[n,(0,y.jsx)(`p`,{dir:`auto`,className:s(`min-w-0 flex-1`,r?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(t,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":a(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:i})]})}function I({items:e,onAnswer:t}){return(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(N,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:A,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(P,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function L({popover:e,onAnswer:n,onView:r}){let{t:i}=f(),[s,l]=(0,v.useState)(``),u=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{u.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&n?.({kind:`secret`,value:s})},children:[(0,y.jsx)(F,{icon:(0,y.jsx)(H,{providerKey:e.providerKey}),title:e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(a,{ref:u,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:o,label:e.label===``?i(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{l(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(t,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(t,{variant:`primary`,type:`submit`,disabled:s===``,children:i(`companionPopover.confirm`)})]})]})}function R({popover:e,onAnswer:n,onOpenLink:r}){let{t:i}=f(),[a,o]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>n?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(z,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:U(e.actions).map(e=>(0,y.jsx)(t,{variant:W(e),disabled:a,onClick:()=>{o(!0),n?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(t,{variant:`primary`,onClick:()=>n?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function z({body:e,onOpenLink:t}){return(0,y.jsx)(i,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:V,urlTransform:B})}var B=e=>/^data:image\//i.test(e)?e:d(e),V=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function H({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(n,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var U=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],W=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`;case`tertiary`:return`ghost`}};function G({tone:e,onClick:n,type:r=`button`,disabled:i,children:a}){return(0,y.jsx)(t,{shape:`pill`,type:r,disabled:i,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:s(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:n,children:a})}export{O as n,D as t};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,Gr as n,Kr as r,MS as i,QS as a,Xg as o,Zo as s,oC as c}from"./app-BNxKtvfM.js";import{t as l,x as u}from"./react-BJ4PZBJN.js";import{lt as d,w as f}from"./vendor-CezcraPH.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-Dwi7aA1Y.js";var v=e(u(),1),y=l();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:s(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(c,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=f();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:n}){let{t:r}=f(),{playing:i,play:a,stop:o}=C();return(0,y.jsx)(x,{label:r(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=i===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${r(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>n?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(t,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?r(`companionPopover.stopPreview`):r(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?o():a(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`;function D({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:a,attached:o=!1,className:c,style:l}){let{t:u}=f();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`w-max max-w-[640px] rounded-[22px]`,E,c),style:l,children:(0,y.jsx)(O,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!o&&`rounded-[20px] border border-white/10 bg-[#17181b] shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,c),style:l,children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(I,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(L,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{title:u(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(R,{popover:e,onAnswer:r,onOpenLink:a})})}function O({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=f(),a=e.kind===`approvals`?e.items[0]:void 0,o=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:s(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(H,{providerKey:e.providerKey}):null,(0,y.jsx)(N,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:k,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):o&&a!==void 0?a.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:o&&a!==void 0?(0,y.jsx)(P,{item:a,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(G,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var k=440,A=400;function j(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>M)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var M=48;function N({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=j(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function P({item:e,pill:n,onAnswer:r}){let{t:i}=f(),a=()=>r?.({kind:`deny`,itemId:e.id}),o=()=>r?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return n?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G,{tone:`negative`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(G,{tone:`primary`,onClick:o,children:i(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t,{variant:`dangerOutline`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(t,{variant:`primary`,onClick:o,children:i(`companionPopover.allow`)})]})}function F({title:e,icon:n,emphasis:r=!1,onClose:i}){let{t:a}=f();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[n,(0,y.jsx)(`p`,{dir:`auto`,className:s(`min-w-0 flex-1`,r?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(t,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":a(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:i})]})}function I({items:e,onAnswer:t}){return(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(N,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:A,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(P,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function L({popover:e,onAnswer:n,onView:r}){let{t:i}=f(),[s,l]=(0,v.useState)(``),u=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{u.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&n?.({kind:`secret`,value:s})},children:[(0,y.jsx)(F,{icon:(0,y.jsx)(H,{providerKey:e.providerKey}),title:e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(a,{ref:u,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:o,label:e.label===``?i(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{l(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(t,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(t,{variant:`primary`,type:`submit`,disabled:s===``,children:i(`companionPopover.confirm`)})]})]})}function R({popover:e,onAnswer:n,onOpenLink:r}){let{t:i}=f(),[a,o]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(F,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>n?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(z,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:U(e.actions).map(e=>(0,y.jsx)(t,{variant:W(e),disabled:a,onClick:()=>{o(!0),n?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(t,{variant:`primary`,onClick:()=>n?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function z({body:e,onOpenLink:t}){return(0,y.jsx)(i,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:V,urlTransform:B})}var B=e=>/^data:image\//i.test(e)?e:d(e),V=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function H({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(n,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var U=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],W=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`;case`tertiary`:return`ghost`}};function G({tone:e,onClick:n,type:r=`button`,disabled:i,children:a}){return(0,y.jsx)(t,{shape:`pill`,type:r,disabled:i,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:s(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:n,children:a})}export{O as n,D as t};
|
package/dist/assets/{companion-popover-page-Slqq_QRZ.js → companion-popover-page-CcjHgR5K.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Hl as n,Kl as r,Nl as i,Tl as a,Vl as o}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Hl as n,Kl as r,Nl as i,Tl as a,Vl as o}from"./app-BNxKtvfM.js";import{t as s,x as c}from"./react-BJ4PZBJN.js";import{t as l}from"./companion-popover-ojFFv5gc.js";var u=e(c(),1),d=s();function f(){let[e,s]=(0,u.useState)(null),c=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=r(s);return t().then(e=>{e&&s(e)}),e},[]);let f=e?.popover,p=f?.id,m=e?.popoverView??`row`;return(0,u.useLayoutEffect)(()=>{let e=c.current;if(p===void 0||e===null)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();o(p,Math.ceil(t)+24,Math.ceil(n)+24)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[p,m]),f===void 0?null:(0,d.jsx)(`div`,{"data-theme":`dark`,className:`h-screen w-screen bg-transparent select-none`,style:{padding:12},children:(0,d.jsx)(l,{popover:f,view:m,cardRef:c,style:{maxHeight:536},onAnswer:e=>{a(e,f.id)},onView:e=>{n(f.id,e)},onOpenLink:e=>{i(e)}},f.id)})}export{f as CompanionPopoverPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,Gg as n,Jg as r,Ma as i,Ql as a,Yg as o,af as s,as as c,cf as l,eS as u,e_ as d,ea as f,hn as p,oC as m,of as h,qg as g,sf as _}from"./app-CGffgaON.js";import{t as v,x as y}from"./react-BJ4PZBJN.js";import{d as b,s as x,w as S}from"./vendor-CezcraPH.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-Dwi7aA1Y.js";import{l as F,n as I,t as se}from"./permission-setup-C3D0R4tU.js";import{t as ce}from"./companion-layout-C8BAml92.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(y(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let t=e===null?null:pe[e]??null,n=e!==null,[r,i]=(0,L.useState)(void 0),[o,d]=(0,L.useState)(null),f=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(d(null),!n)return;let e=!0,r=!1,o=0,p=!1,m=!1,g=null,v=async()=>{if(!(!e||r||m||g!==`ready`)){m=!0;try{let t=await c();if(!e||r||g!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;g=null,I(),await a()}catch(e){u(e,{context:`companionIntro.resumeAfterPermission`})}finally{m=!1}}},y=(n,r=!1)=>{e&&(i(e=>JSON.stringify(e)===JSON.stringify(n)?e:n),r||d(null),g!==null&&t!==null&&(g=n?n[t].status===`granted`?`ready`:`waiting`:null,v()))},b=n=>{e&&(t!==null&&d({kind:t,phase:`error`}),u(n,{context:`companionIntro.permission`,tags:{kind:t??`tour`}}))},x=async()=>{if(p||r)return;p=!0;let t=o;try{let n=await s();e&&t===o&&!r&&y(n),n===null&&clearInterval(S)}catch(e){t===o&&!r&&b(e)}finally{p=!1}},S=setInterval(()=>{x()},2e3),C=l(e=>{o+=1,y(e,r)});return x(),f.current=n=>{!e||r||t===null||(r=!0,o+=1,d({kind:t,phase:`requesting`}),(async()=>{try{let r=await s();if(!e)return;if(!r){y(null);return}let i=r[t];if(i.status===`granted`||i.status===`restricted`){y(r);return}let a=o;g=`waiting`;let c=t!==`microphone`&&F()?await se(t,n):fe(t,i)?await h(t):await _(t);e&&(a===o?y(c?{...r,[t]:c}:null):d(null))}catch(e){g=null,b(e)}finally{r=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[t,n]),t===null||r===null?null:{kind:t,state:o?.kind===t?{phase:o.phase}:r?{phase:`known`,item:r[t]}:{phase:`checking`},enable:e=>f.current(e)}}var z=v();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:t=`right`,cardGrowth:r=`up`,avatarBox:i=n,optionsBox:a=n,cardRef:o,onAnswer:s}){let{t:c}=S(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:p,introStepOff:h}=ce(i,a),g=u(h(r)),_=p(t,-d),v={top:f(r,0),transform:r===`up`?`translateY(calc(-100% - ${g}px))`:`translateY(${g}px)`};return(0,z.jsxs)(`div`,{ref:o,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,..._,...v},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(m,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t:n}=S(),r=(0,L.useRef)(null),{state:i}=e,a=i.phase===`known`?i.item:null,o=i.phase===`checking`||i.phase===`requesting`,s=fe(e.kind,a),c=a?.status===`restricted`,l=i.phase===`error`||a?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:r,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:n(u.body)}),(0,z.jsx)(t,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||i.phase===`checking`,onClick:()=>{let t=r.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:n(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?n(`companionIntro.permission.restricted`):l?n(`companionIntro.permission.error`):s?n(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?n(`companionIntro.permission.waiting`):e.kind===`microphone`?n(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>d(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:i=`up`,avatarBox:a=n,optionsBox:s=n,accentHex:c,assistantName:l,cardRef:u,onAdvance:f,permission:p=null,greeted:m=!1,voiceKeyTaps:h=0,chordPresses:_=0,chordControl:v}){let{t:y}=S(),b=g.indexOf(e),x=b===g.length-1,C=b<=0,w=xe[e],T=R(p),ee=p?.state.phase===`checking`,E=r[e],D=d(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[h]);let[te,j]=(0,L.useState)(h),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?h<te&&j(h):(ie(e),j(h),M(_));let ae=Math.min(Math.max(h-te,0),2);_<ne&&M(_);let oe=D!==void 0&&v===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(a,s),de=i===`down`||B(e)===void 0?P(ue(i)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(i,0),transform:i===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:u,role:`group`,"aria-label":y(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":y(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>f?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&l!==void 0?y(w.titleNamed,{name:l}):y(w.title)})}),ee?null:T&&p!==null?(0,z.jsx)(ye,{permission:p}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:y(e===`talk`&&m?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:y(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:y(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:y(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:y(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:o.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?c??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>f?.(`back`),children:y(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>f?.(`next`),children:y(x?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=S(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:r=!1,edge:a,interval:o=Me,className:s,style:c}){let l=x(),u=(0,L.useMemo)(()=>p(i,e),[e]),d=Be(n&&!r&&!l&&u!==null,o),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(d===0)return;_(Ne()),h(!0);let e=setTimeout(()=>{h(!1)},Pe);return()=>{clearTimeout(e)}},[d]),u===null||l)return null;let v=Re(u,t.width),y=r||m,S=a??g,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${s??``}`,style:{width:t.width,height:t.height,...c},"data-risen":y,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(b.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:y?0:v.rest},transition:r?{duration:0}:y?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(f,{components:i,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:r=We,avatarSrc:i,character:a,hovered:o=!1,growth:s=`right`,avatarBox:c=n,optionsBox:l=n,cardGrowth:u=`up`,dock:d=`bottom`,rootRef:f,restingPillRef:p,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:v=!1,avatarTucked:y=!1,onWatch:b,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=S(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=d===`left`||d===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:r}):void 0),[we,Se,H,V,r]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!v){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[v,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=x(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(c,l),et=e===`call`,Y=et&&(d===`left`||d===`right`),tt=Y?d===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:n+(Be?.width??Ze[e])+8:0,dt=W?n+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(u,0),yt=Qe(s,s===`left`?l/2:-(l/2)),bt=c/n,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-n/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-n/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:d,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&s===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:f,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:n,paddingBottom:8,paddingInline:8}:s===`left`?{paddingLeft:8,paddingRight:n}:{paddingLeft:n,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?d===`left`?`right`:`left`:u===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:b,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?d===`left`?`right`:`left`:d===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:r,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:b})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:p,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(r,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!y?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openCadet`:`companionSurface.talk`),accentHex:r,avatarSrc:i,character:a,attentive:o,busy:Le||F||Ie,collapsed:!Ee&&(!St||y),restingScale:n/c,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:r=!1,attentive:a=!1,collapsed:o=!1,restingScale:s=1,label:c,style:l,elementRef:u,onPointerDown:d,onContextMenu:p,onClick:m}){let h=x();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":c,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:p,onClick:m,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:o&&!r,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${s})`,opacity:+!!o}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!o,transform:o?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(f,{components:i,traits:n,size:K,isAssistantBusy:r,attentive:a})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=S(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=S();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=S();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=S();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:v,onShare:y,onStopShare:b,onAnnotate:x,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=S();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:v}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:v}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:y,onStopShare:b}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:x,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=S();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=S();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=S(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=S();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=S();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=S();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=S(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,Gg as n,Jg as r,Ma as i,Ql as a,Yg as o,af as s,as as c,cf as l,eS as u,e_ as d,ea as f,hn as p,oC as m,of as h,qg as g,sf as _}from"./app-BNxKtvfM.js";import{t as v,x as y}from"./react-BJ4PZBJN.js";import{d as b,s as x,w as S}from"./vendor-CezcraPH.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-Dwi7aA1Y.js";import{l as F,n as I,t as se}from"./permission-setup-DohBLdCl.js";import{t as ce}from"./companion-layout-BJ70ZoB6.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(y(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let t=e===null?null:pe[e]??null,n=e!==null,[r,i]=(0,L.useState)(void 0),[o,d]=(0,L.useState)(null),f=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(d(null),!n)return;let e=!0,r=!1,o=0,p=!1,m=!1,g=null,v=async()=>{if(!(!e||r||m||g!==`ready`)){m=!0;try{let t=await c();if(!e||r||g!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;g=null,I(),await a()}catch(e){u(e,{context:`companionIntro.resumeAfterPermission`})}finally{m=!1}}},y=(n,r=!1)=>{e&&(i(e=>JSON.stringify(e)===JSON.stringify(n)?e:n),r||d(null),g!==null&&t!==null&&(g=n?n[t].status===`granted`?`ready`:`waiting`:null,v()))},b=n=>{e&&(t!==null&&d({kind:t,phase:`error`}),u(n,{context:`companionIntro.permission`,tags:{kind:t??`tour`}}))},x=async()=>{if(p||r)return;p=!0;let t=o;try{let n=await s();e&&t===o&&!r&&y(n),n===null&&clearInterval(S)}catch(e){t===o&&!r&&b(e)}finally{p=!1}},S=setInterval(()=>{x()},2e3),C=l(e=>{o+=1,y(e,r)});return x(),f.current=n=>{!e||r||t===null||(r=!0,o+=1,d({kind:t,phase:`requesting`}),(async()=>{try{let r=await s();if(!e)return;if(!r){y(null);return}let i=r[t];if(i.status===`granted`||i.status===`restricted`){y(r);return}let a=o;g=`waiting`;let c=t!==`microphone`&&F()?await se(t,n):fe(t,i)?await h(t):await _(t);e&&(a===o?y(c?{...r,[t]:c}:null):d(null))}catch(e){g=null,b(e)}finally{r=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[t,n]),t===null||r===null?null:{kind:t,state:o?.kind===t?{phase:o.phase}:r?{phase:`known`,item:r[t]}:{phase:`checking`},enable:e=>f.current(e)}}var z=v();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:t=`right`,cardGrowth:r=`up`,avatarBox:i=n,optionsBox:a=n,cardRef:o,onAnswer:s}){let{t:c}=S(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:p,introStepOff:h}=ce(i,a),g=u(h(r)),_=p(t,-d),v={top:f(r,0),transform:r===`up`?`translateY(calc(-100% - ${g}px))`:`translateY(${g}px)`};return(0,z.jsxs)(`div`,{ref:o,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,..._,...v},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(m,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t:n}=S(),r=(0,L.useRef)(null),{state:i}=e,a=i.phase===`known`?i.item:null,o=i.phase===`checking`||i.phase===`requesting`,s=fe(e.kind,a),c=a?.status===`restricted`,l=i.phase===`error`||a?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:r,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:n(u.body)}),(0,z.jsx)(t,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||i.phase===`checking`,onClick:()=>{let t=r.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:n(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?n(`companionIntro.permission.restricted`):l?n(`companionIntro.permission.error`):s?n(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?n(`companionIntro.permission.waiting`):e.kind===`microphone`?n(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>d(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:i=`up`,avatarBox:a=n,optionsBox:s=n,accentHex:c,assistantName:l,cardRef:u,onAdvance:f,permission:p=null,greeted:m=!1,voiceKeyTaps:h=0,chordPresses:_=0,chordControl:v}){let{t:y}=S(),b=g.indexOf(e),x=b===g.length-1,C=b<=0,w=xe[e],T=R(p),ee=p?.state.phase===`checking`,E=r[e],D=d(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[h]);let[te,j]=(0,L.useState)(h),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?h<te&&j(h):(ie(e),j(h),M(_));let ae=Math.min(Math.max(h-te,0),2);_<ne&&M(_);let oe=D!==void 0&&v===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(a,s),de=i===`down`||B(e)===void 0?P(ue(i)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(i,0),transform:i===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:u,role:`group`,"aria-label":y(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":y(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>f?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&l!==void 0?y(w.titleNamed,{name:l}):y(w.title)})}),ee?null:T&&p!==null?(0,z.jsx)(ye,{permission:p}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:y(e===`talk`&&m?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:y(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:y(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:y(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:y(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:o.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?c??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>f?.(`back`),children:y(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>f?.(`next`),children:y(x?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=S(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:r=!1,edge:a,interval:o=Me,className:s,style:c}){let l=x(),u=(0,L.useMemo)(()=>p(i,e),[e]),d=Be(n&&!r&&!l&&u!==null,o),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(d===0)return;_(Ne()),h(!0);let e=setTimeout(()=>{h(!1)},Pe);return()=>{clearTimeout(e)}},[d]),u===null||l)return null;let v=Re(u,t.width),y=r||m,S=a??g,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${s??``}`,style:{width:t.width,height:t.height,...c},"data-risen":y,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(b.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:y?0:v.rest},transition:r?{duration:0}:y?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(f,{components:i,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:r=We,avatarSrc:i,character:a,hovered:o=!1,growth:s=`right`,avatarBox:c=n,optionsBox:l=n,cardGrowth:u=`up`,dock:d=`bottom`,rootRef:f,restingPillRef:p,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:v=!1,avatarTucked:y=!1,onWatch:b,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=S(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=d===`left`||d===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:r}):void 0),[we,Se,H,V,r]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!v){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[v,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=x(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(c,l),et=e===`call`,Y=et&&(d===`left`||d===`right`),tt=Y?d===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:n+(Be?.width??Ze[e])+8:0,dt=W?n+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(u,0),yt=Qe(s,s===`left`?l/2:-(l/2)),bt=c/n,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-n/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-n/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:d,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&s===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:f,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:n,paddingBottom:8,paddingInline:8}:s===`left`?{paddingLeft:8,paddingRight:n}:{paddingLeft:n,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?d===`left`?`right`:`left`:u===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:b,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?d===`left`?`right`:`left`:d===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:r,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:b})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:p,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(r,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!y?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openCadet`:`companionSurface.talk`),accentHex:r,avatarSrc:i,character:a,attentive:o,busy:Le||F||Ie,collapsed:!Ee&&(!St||y),restingScale:n/c,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:r=!1,attentive:a=!1,collapsed:o=!1,restingScale:s=1,label:c,style:l,elementRef:u,onPointerDown:d,onContextMenu:p,onClick:m}){let h=x();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":c,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:p,onClick:m,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:o&&!r,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${s})`,opacity:+!!o}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!o,transform:o?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(f,{components:i,traits:n,size:K,isAssistantBusy:r,attentive:a})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=S(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=S();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=S();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=S();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:v,onShare:y,onStopShare:b,onAnnotate:x,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=S();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:v}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:v}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:y,onStopShare:b}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:x,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=S();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=S();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=S(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=S();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=S();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=S();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=S(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
|
package/dist/assets/{companion-surface-page-BCDuCzpC.js → companion-surface-page-BxYp5tfL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,Al as n,Bl as r,CC as i,Dl as a,El as o,Gg as s,Gl as c,HS as ee,Hl as l,Il as u,Jl as d,Kl as f,Ll as p,Ml as te,Nl as m,Ol as ne,Pl as h,Rl as re,Sl as g,Tl as _,Ul as v,Wl as y,Yl as ie,cf as b,jl as x,kl as S,oC as C,of as ae,ql as oe,t_ as se,wl as ce,xl as w,yl as T}from"./app-CGffgaON.js";import{t as E,x as D}from"./react-BJ4PZBJN.js";import{w as le}from"./vendor-CezcraPH.js";import{Ka as O,yn as ue}from"./icons-Dwi7aA1Y.js";import{a as de,c as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as ye}from"./companion-surface-2FTY6hzz.js";import{n as be}from"./companion-accent-BnQ_HHAs.js";import{n as xe,t as Se}from"./companion-popover-9C2r1GyG.js";import{l as Ce,t as we}from"./permission-setup-C3D0R4tU.js";import{n as k,r as Te,t as A}from"./companion-layout-C8BAml92.js";var j=e(D(),1),M=E(),Ee=460,De=3,N=88,Oe=3,ke=[`screens`,`tabs`,`windows`],Ae=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,je=e=>ke.find(t=>Ae(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Me({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:r,avatarBox:a=s,optionsBox:o=s,cardRef:c,label:l,onPick:u,onAllowScreenRecording:d}){let{t:f}=le(),{inUnits:p,lineAt:te,edgeAt:m,introStepOff:ne,gap:h}=A(a,o),re=p(ne(n)),g=r===void 0?{left:`50%`,top:te(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${re}px))`:`translate(-50%, ${re}px)`}:{...m(r,se(a,o)+h),top:`50%`,transform:`translateY(-50%)`},_=e!==null&&e.screenRecordingGranted===!1,v=_?null:e,y=v===null?[]:ke.filter(e=>Ae(v,e)>0),ie=v!==null&&y.length===0,[b,x]=(0,j.useState)(null),S=v===null?`screens`:b!==null&&y.includes(b)?b:je(v),ae=(0,j.useMemo)(()=>v===null?[]:S===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):S===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[S,v]),[oe,ce]=(0,j.useState)(new Map),w=(0,j.useRef)(new Set),T=(0,j.useRef)(0),E=(0,j.useRef)(!1);(0,j.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]),(0,j.useEffect)(()=>{w.current=new Set,T.current+=1,ce(new Map),x(null)},[e]);let D=(0,j.useRef)(null);(0,j.useEffect)(()=>{D.current!==null&&(D.current.scrollTop=0)},[S]),(0,j.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ae){if(w.current.has(e))continue;w.current.add(e);let r=T.current,i=t=>{!E.current||r!==T.current||ce(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ae]);let O=e=>t===void 0?null:oe.get(e),de=e=>f(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,M.jsxs)(`div`,{ref:c,role:`group`,"aria-label":l??f(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:Ee,...g},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,M.jsx)(ee,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:de(e)})),value:S,ariaLabel:f(`companionSurface.captureKind`),onChange:x}),(0,M.jsx)(C,{ref:D,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,M.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,M.jsx)(Pe,{}),_&&(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,M.jsx)(`span`,{className:`text-[12px] text-white/70`,children:f(`companionSurface.captureScreenRecordingOff`)}),(0,M.jsx)(i,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:d,children:f(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&S===`screens`&&(0,M.jsx)(F,{children:v.displays.map(e=>{let t=f(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,M.jsx)(I,{title:t,ariaLabel:t,answer:O(n),fallback:(0,M.jsx)(ue,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{u?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&S===`windows`&&(0,M.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,M.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:O(t),fallback:(0,M.jsx)(L,{icon:e.icon,large:!0}),icon:(0,M.jsx)(L,{icon:e.icon}),onClick:()=>{u?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&S===`tabs`&&(0,M.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,M.jsx)(Ne,{icon:(0,M.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{u?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),ie&&(0,M.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:f(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,M.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${De}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,M.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:N},children:n==null?r:(0,M.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function Ne({icon:e,title:t,onClick:n}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,M.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,M.jsx)(O,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,M.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Pe(){return(0,M.jsx)(F,{children:Array.from({length:Oe},(e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,M.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:N}}),(0,M.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Fe=3,Ie=440;function Le(){let{t:e}=le(),[i,ee]=(0,j.useState)(`right`),[C,se]=(0,j.useState)(`up`),[E,D]=(0,j.useState)(`bottom`),[O,ue]=(0,j.useState)(s),[A,Ee]=(0,j.useState)(s),[De,N]=(0,j.useState)(),[Oe,ke]=(0,j.useState)(),[Ae,je]=(0,j.useState)(),[P,F]=(0,j.useState)(null),[I,Ne]=(0,j.useState)(!1),[L,Pe]=(0,j.useState)(void 0),[Le,Re]=(0,j.useState)(``),[ze,Be]=(0,j.useState)(``),[Ve,He]=(0,j.useState)(!1),[R,Ue]=(0,j.useState)(!1),[We,Ge]=(0,j.useState)(void 0),[z,Ke]=(0,j.useState)(void 0),[B,qe]=(0,j.useState)(void 0),[V,Je]=(0,j.useState)(void 0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(!1),[$e,et]=(0,j.useState)(void 0),[tt,nt]=(0,j.useState)(!1),[rt,it]=(0,j.useState)(!1),[at,ot]=(0,j.useState)(!1),[st,ct]=(0,j.useState)(!1),[lt,ut]=(0,j.useState)(void 0),[H,U]=(0,j.useState)(!1),[W,dt]=(0,j.useState)(`teach`),[ft,pt]=(0,j.useState)(null),G=(0,j.useRef)(0),[mt,K]=(0,j.useState)(!1),[q,ht]=(0,j.useState)(null),[gt,_t]=(0,j.useState)(0),[vt,yt]=(0,j.useState)(0),[bt,xt]=(0,j.useState)(void 0),J=(0,j.useRef)(!1),St=(0,j.useRef)(null),Ct=(0,j.useRef)(null),wt=(0,j.useRef)(null),Tt=(0,j.useRef)(null),Et=(0,j.useRef)(null),Dt=(0,j.useRef)(null),Ot=(0,j.useRef)(null),kt=(0,j.useRef)(null),At=(0,j.useRef)(!1),jt=(0,j.useCallback)(e=>{kt.current=e,e===null&&At.current&&(At.current=!1,J.current=!1,r(!1))},[]),Y=(0,j.useRef)(null),Mt=(0,j.useRef)(null),Nt=(0,j.useRef)(!1);(0,j.useEffect)(()=>{let e=e=>{ee(e.growth),se(e.cardGrowth),D(e.dock??`bottom`),ue(e.avatarBox),Ee(e.optionsBox??e.avatarBox),N(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),ke(e.character),je(e.accentHex),F(e.call),Ne(e.dialing===!0),Be(e.assistantName),He(e.working),Ue(e.watching===!0),Pe(e.dictating),Re(e.dictationText??``),Ge(e.watchRetro),Ke(e.dictationOffer),qe(e.popover),Je(e.popoverView),Xe(e.watchEnabled===!0),Qe(e.watchTargets===!0),et(e.screenShare),nt(e.screenShareEnabled===!0),it(e.annotating===!0),ot((e.coachmarks?.length??0)>0),ct(e.marksCleared!==void 0),ut(e.annotationTool),ht(e.intro),_t(e.voiceKeyTaps??0),yt(e.introChordPresses??0),xt(e.introChordControl)},t=f(e);return n().then(t=>{t&&e(t)}),t},[]),(0,j.useEffect)(()=>()=>{r(!1)},[]);let Pt=P!==null||I,Ft=$e!==void 0,It=(0,j.useMemo)(()=>T()?ie():void 0,[]);(0,j.useEffect)(()=>{Pt||(G.current+=1,U(!1))},[Pt]),(0,j.useEffect)(()=>{R&&W===`teach`&&(G.current+=1,U(!1))},[R,W]),(0,j.useEffect)(()=>{Ft&&W===`share`&&(G.current+=1,U(!1))},[Ft,W]);let Lt=(e,t)=>{pt(null),dt(e),U(!0);let n=++G.current;x().then(e=>{if(n===G.current){if(e!==null){pt(e);return}U(!1),t()}})},Rt=H&&ft?.screenRecordingGranted===!1;(0,j.useEffect)(()=>{if(Rt)return b(e=>{if(e.screen?.status!==`granted`)return;let t=++G.current;x().then(e=>{t!==G.current||e===null||pt(e)})})},[Rt]);let zt=()=>{if(!Ze){d();return}if(H&&W===`teach`){G.current+=1,U(!1);return}Lt(`teach`,d)},Bt=()=>{if(H&&W===`share`){G.current+=1,U(!1);return}Lt(`share`,()=>void 0)};(0,j.useEffect)(()=>{!H&&J.current&&(J.current=!1,r(!1))},[H]),(0,j.useEffect)(()=>{z===void 0&&J.current&&(J.current=!1,r(!1))},[z]);let Vt=(0,j.useRef)(!1),Ht=B!==void 0&&V!==void 0&&V!==`deferred`&&(P!==null||I)&&E!==`left`&&E!==`right`,Ut=Ht?B?.id:void 0;(0,j.useLayoutEffect)(()=>{let e=Ot.current;if(Ut===void 0||e===null)return;let t=()=>{re(Ut,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Ut,V]);let[Wt,Gt]=(0,j.useState)(!1),Kt=Ht||Wt;(0,j.useEffect)(()=>{!Kt&&Vt.current&&(Vt.current=!1,J.current=!1,r(!1))},[Kt]);let qt=e=>{if(G.current+=1,U(!1),W===`share`){v(e);return}d(e)},X=e=>{J.current!==e&&(J.current=e,r(e))},Z=q!==null&&P===null&&!I,Jt=(0,j.useRef)(Z);(0,j.useEffect)(()=>{Jt.current&&!Z&&(K(!1),X(!1)),Jt.current=Z},[Z]);let Yt=he(q),Xt=Z?de(q,e(`companionIntro.call.line`)):null,Zt=ye(Z?q:null),Q=pe(Zt),Qt=Z&&!Q&&(q===`talk`||q===`try`),$t=Z&&q===`idle`&&mt;(0,j.useEffect)(()=>{$t&&g(`next`)},[$t]);let[en,tn]=(0,j.useState)(!1);(0,j.useEffect)(()=>{tn(!1)},[q]);let nn=()=>{q===`try`&&!Q&&g(`try`)},$=Xt!==null,rn=P!==null||I?`call`:L===void 0?z===void 0?R?`watching`:We===void 0?Yt??(mt?`hover`:`resting`):`summary`:`offer`:`dictating`,an=e=>{if(Y.current!==null&&e.buttons===0&&(Y.current=null,h()),Y.current!==null){let{x:t,y:n}=Y.current;te(e.screenX-t,e.screenY-n),Y.current={x:e.screenX,y:e.screenY};let r=Mt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Fe&&(Nt.current=!0);return}let t=wt.current;if(!t)return;let n=St.current?.getBoundingClientRect()??null,r=Ct.current?.getBoundingClientRect()??null,i=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,a=Te({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:i}),o=Tt.current,s=o!==null&&k(o.getBoundingClientRect(),e.clientX,e.clientY),c=Dt.current,ee=c!==null&&k(c.getBoundingClientRect(),e.clientX,e.clientY),l=Et.current,u=l!==null&&k(l.getBoundingClientRect(),e.clientX,e.clientY),d=Ot.current,f=d!==null&&k(d.getBoundingClientRect(),e.clientX,e.clientY),p=kt.current,m=p!==null&&k(p.getBoundingClientRect(),e.clientX,e.clientY);K(a),At.current=m,Vt.current=f,X(a||s||u||ee||m||f)},on=be(P,Ae,Oe),sn=B===void 0||V!==`deferred`?0:B.kind===`approvals`?B.items.length:1;return(0,M.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:an,onMouseUp:()=>{Y.current!==null&&(Y.current=null,h())},onPointerCancel:()=>{Y.current!==null&&(Y.current=null,h()),K(!1),X(!1)},onMouseLeave:()=>{Y.current===null&&(K(!1),X(!1))},children:(0,M.jsx)(ve,{phase:rn,growth:i,cardGrowth:C,dock:E,avatarBox:O,optionsBox:A,avatarSrc:De,character:Oe,hovered:mt,accentHex:on,call:P??Xt?.call??void 0,assistantName:ze,dictating:L,dictationText:Le,working:Ve,watching:R,watchRetro:We,onWatchRetro:o,dictationOffer:z,offer:z===void 0?null:(0,M.jsx)(fe,{offer:z,growth:i,cardGrowth:C,avatarBox:O,optionsBox:A,cardRef:Dt,onAnswer:e=>{ce(e,z.id)}}),watchEnabled:Ye,spotlight:_e(q),avatarStaged:Qt,avatarTucked:Z&&q===`idle`,intro:!Z||q===null?null:(0,M.jsx)(me,{beat:q,growth:i,cardGrowth:C,avatarBox:O,optionsBox:A,accentHex:on,assistantName:ze===``?void 0:ze,cardRef:Tt,permission:Zt,greeted:en,voiceKeyTaps:gt,chordPresses:vt,chordControl:bt,onAdvance:e=>{if(e===`try`){nn();return}g(e)}}),rootRef:St,restingPillRef:Ct,avatarRef:wt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),Y.current={x:e.screenX,y:e.screenY},Mt.current={x:e.screenX,y:e.screenY},Nt.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),y())},onAvatarClick:()=>{if(!(Nt.current||$)){if(q!==null){Z&&!Q&&(q===`talk`?tn(!0):q===`try`&&nn());return}if(P!==null||I){w();return}c()}},onWatch:()=>{$||d()},onTeach:$?void 0:zt,picking:H&&W===`teach`,sharing:Xt?.sharing??Ft,shareEnabled:$||tt,sharePicking:H&&W===`share`,onShare:$?void 0:Bt,onStopShare:$?void 0:()=>{v()},annotating:rt,onAnnotate:$?void 0:e=>{u(e)},marked:st&&(at||rt),onClearMarks:$?void 0:()=>{ne()},openPicker:B?.kind===`microphones`?B.kind:void 0,onPicker:!$&&S()?e=>{oe(e)}:void 0,annotationTool:lt,onAnnotationTool:$?void 0:e=>{p(e)},drawToolsRef:jt,shortcuts:$?ge:It,picker:H?(0,M.jsx)(Me,{sources:ft,captureThumbnail:a,cardGrowth:C,side:(P!==null||I)&&(E===`left`||E===`right`)?E===`left`?`right`:`left`:void 0,avatarBox:O,optionsBox:A,cardRef:Et,label:W===`share`?e(`companionSurface.sharePicker`):void 0,onPick:qt,onAllowScreenRecording:()=>{(Ce()?we(`screen`):ae(`screen`)).catch(()=>void 0)}}):null,prompt:!Ht||B===void 0?null:V===`row`&&(B.kind===`approvals`||B.kind===`secret`)?(0,M.jsx)(xe,{popover:B,onAnswer:e=>{_(e,B.id)},onView:e=>{l(B.id,e)}}):(0,M.jsx)(Se,{attached:!0,popover:B,view:V??`expanded`,style:{maxHeight:Ie},onAnswer:e=>{_(e,B.id)},onView:e=>{l(B.id,e)},onOpenLink:e=>{m(e)}},B.id),promptRef:Ot,onWorkShelfChange:Gt,promptsDeferred:sn,onReviewPrompts:()=>{B!==void 0&&l(B.id,`expanded`)},onControl:$?void 0:(e,n)=>{t(n===void 0?{action:e}:{action:e,requestId:n})}})})}export{Le as CompanionSurfacePage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,Al as n,Bl as r,CC as i,Dl as a,El as o,Gg as s,Gl as c,HS as ee,Hl as l,Il as u,Jl as d,Kl as f,Ll as p,Ml as te,Nl as m,Ol as ne,Pl as h,Rl as re,Sl as g,Tl as _,Ul as v,Wl as y,Yl as ie,cf as b,jl as x,kl as S,oC as C,of as ae,ql as oe,t_ as se,wl as ce,xl as w,yl as T}from"./app-BNxKtvfM.js";import{t as E,x as D}from"./react-BJ4PZBJN.js";import{w as le}from"./vendor-CezcraPH.js";import{Ka as O,yn as ue}from"./icons-Dwi7aA1Y.js";import{a as de,c as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as ye}from"./companion-surface-BheNXy_6.js";import{n as be}from"./companion-accent-DNqagkeK.js";import{n as xe,t as Se}from"./companion-popover-ojFFv5gc.js";import{l as Ce,t as we}from"./permission-setup-DohBLdCl.js";import{n as k,r as Te,t as A}from"./companion-layout-BJ70ZoB6.js";var j=e(D(),1),M=E(),Ee=460,De=3,N=88,Oe=3,ke=[`screens`,`tabs`,`windows`],Ae=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,je=e=>ke.find(t=>Ae(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Me({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:r,avatarBox:a=s,optionsBox:o=s,cardRef:c,label:l,onPick:u,onAllowScreenRecording:d}){let{t:f}=le(),{inUnits:p,lineAt:te,edgeAt:m,introStepOff:ne,gap:h}=A(a,o),re=p(ne(n)),g=r===void 0?{left:`50%`,top:te(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${re}px))`:`translate(-50%, ${re}px)`}:{...m(r,se(a,o)+h),top:`50%`,transform:`translateY(-50%)`},_=e!==null&&e.screenRecordingGranted===!1,v=_?null:e,y=v===null?[]:ke.filter(e=>Ae(v,e)>0),ie=v!==null&&y.length===0,[b,x]=(0,j.useState)(null),S=v===null?`screens`:b!==null&&y.includes(b)?b:je(v),ae=(0,j.useMemo)(()=>v===null?[]:S===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):S===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[S,v]),[oe,ce]=(0,j.useState)(new Map),w=(0,j.useRef)(new Set),T=(0,j.useRef)(0),E=(0,j.useRef)(!1);(0,j.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]),(0,j.useEffect)(()=>{w.current=new Set,T.current+=1,ce(new Map),x(null)},[e]);let D=(0,j.useRef)(null);(0,j.useEffect)(()=>{D.current!==null&&(D.current.scrollTop=0)},[S]),(0,j.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ae){if(w.current.has(e))continue;w.current.add(e);let r=T.current,i=t=>{!E.current||r!==T.current||ce(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ae]);let O=e=>t===void 0?null:oe.get(e),de=e=>f(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,M.jsxs)(`div`,{ref:c,role:`group`,"aria-label":l??f(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:Ee,...g},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,M.jsx)(ee,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:de(e)})),value:S,ariaLabel:f(`companionSurface.captureKind`),onChange:x}),(0,M.jsx)(C,{ref:D,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,M.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,M.jsx)(Pe,{}),_&&(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,M.jsx)(`span`,{className:`text-[12px] text-white/70`,children:f(`companionSurface.captureScreenRecordingOff`)}),(0,M.jsx)(i,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:d,children:f(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&S===`screens`&&(0,M.jsx)(F,{children:v.displays.map(e=>{let t=f(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,M.jsx)(I,{title:t,ariaLabel:t,answer:O(n),fallback:(0,M.jsx)(ue,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{u?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&S===`windows`&&(0,M.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,M.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:O(t),fallback:(0,M.jsx)(L,{icon:e.icon,large:!0}),icon:(0,M.jsx)(L,{icon:e.icon}),onClick:()=>{u?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&S===`tabs`&&(0,M.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,M.jsx)(Ne,{icon:(0,M.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{u?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),ie&&(0,M.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:f(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,M.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${De}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,M.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:N},children:n==null?r:(0,M.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function Ne({icon:e,title:t,onClick:n}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,M.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,M.jsx)(O,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,M.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Pe(){return(0,M.jsx)(F,{children:Array.from({length:Oe},(e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,M.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:N}}),(0,M.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Fe=3,Ie=440;function Le(){let{t:e}=le(),[i,ee]=(0,j.useState)(`right`),[C,se]=(0,j.useState)(`up`),[E,D]=(0,j.useState)(`bottom`),[O,ue]=(0,j.useState)(s),[A,Ee]=(0,j.useState)(s),[De,N]=(0,j.useState)(),[Oe,ke]=(0,j.useState)(),[Ae,je]=(0,j.useState)(),[P,F]=(0,j.useState)(null),[I,Ne]=(0,j.useState)(!1),[L,Pe]=(0,j.useState)(void 0),[Le,Re]=(0,j.useState)(``),[ze,Be]=(0,j.useState)(``),[Ve,He]=(0,j.useState)(!1),[R,Ue]=(0,j.useState)(!1),[We,Ge]=(0,j.useState)(void 0),[z,Ke]=(0,j.useState)(void 0),[B,qe]=(0,j.useState)(void 0),[V,Je]=(0,j.useState)(void 0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(!1),[$e,et]=(0,j.useState)(void 0),[tt,nt]=(0,j.useState)(!1),[rt,it]=(0,j.useState)(!1),[at,ot]=(0,j.useState)(!1),[st,ct]=(0,j.useState)(!1),[lt,ut]=(0,j.useState)(void 0),[H,U]=(0,j.useState)(!1),[W,dt]=(0,j.useState)(`teach`),[ft,pt]=(0,j.useState)(null),G=(0,j.useRef)(0),[mt,K]=(0,j.useState)(!1),[q,ht]=(0,j.useState)(null),[gt,_t]=(0,j.useState)(0),[vt,yt]=(0,j.useState)(0),[bt,xt]=(0,j.useState)(void 0),J=(0,j.useRef)(!1),St=(0,j.useRef)(null),Ct=(0,j.useRef)(null),wt=(0,j.useRef)(null),Tt=(0,j.useRef)(null),Et=(0,j.useRef)(null),Dt=(0,j.useRef)(null),Ot=(0,j.useRef)(null),kt=(0,j.useRef)(null),At=(0,j.useRef)(!1),jt=(0,j.useCallback)(e=>{kt.current=e,e===null&&At.current&&(At.current=!1,J.current=!1,r(!1))},[]),Y=(0,j.useRef)(null),Mt=(0,j.useRef)(null),Nt=(0,j.useRef)(!1);(0,j.useEffect)(()=>{let e=e=>{ee(e.growth),se(e.cardGrowth),D(e.dock??`bottom`),ue(e.avatarBox),Ee(e.optionsBox??e.avatarBox),N(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),ke(e.character),je(e.accentHex),F(e.call),Ne(e.dialing===!0),Be(e.assistantName),He(e.working),Ue(e.watching===!0),Pe(e.dictating),Re(e.dictationText??``),Ge(e.watchRetro),Ke(e.dictationOffer),qe(e.popover),Je(e.popoverView),Xe(e.watchEnabled===!0),Qe(e.watchTargets===!0),et(e.screenShare),nt(e.screenShareEnabled===!0),it(e.annotating===!0),ot((e.coachmarks?.length??0)>0),ct(e.marksCleared!==void 0),ut(e.annotationTool),ht(e.intro),_t(e.voiceKeyTaps??0),yt(e.introChordPresses??0),xt(e.introChordControl)},t=f(e);return n().then(t=>{t&&e(t)}),t},[]),(0,j.useEffect)(()=>()=>{r(!1)},[]);let Pt=P!==null||I,Ft=$e!==void 0,It=(0,j.useMemo)(()=>T()?ie():void 0,[]);(0,j.useEffect)(()=>{Pt||(G.current+=1,U(!1))},[Pt]),(0,j.useEffect)(()=>{R&&W===`teach`&&(G.current+=1,U(!1))},[R,W]),(0,j.useEffect)(()=>{Ft&&W===`share`&&(G.current+=1,U(!1))},[Ft,W]);let Lt=(e,t)=>{pt(null),dt(e),U(!0);let n=++G.current;x().then(e=>{if(n===G.current){if(e!==null){pt(e);return}U(!1),t()}})},Rt=H&&ft?.screenRecordingGranted===!1;(0,j.useEffect)(()=>{if(Rt)return b(e=>{if(e.screen?.status!==`granted`)return;let t=++G.current;x().then(e=>{t!==G.current||e===null||pt(e)})})},[Rt]);let zt=()=>{if(!Ze){d();return}if(H&&W===`teach`){G.current+=1,U(!1);return}Lt(`teach`,d)},Bt=()=>{if(H&&W===`share`){G.current+=1,U(!1);return}Lt(`share`,()=>void 0)};(0,j.useEffect)(()=>{!H&&J.current&&(J.current=!1,r(!1))},[H]),(0,j.useEffect)(()=>{z===void 0&&J.current&&(J.current=!1,r(!1))},[z]);let Vt=(0,j.useRef)(!1),Ht=B!==void 0&&V!==void 0&&V!==`deferred`&&(P!==null||I)&&E!==`left`&&E!==`right`,Ut=Ht?B?.id:void 0;(0,j.useLayoutEffect)(()=>{let e=Ot.current;if(Ut===void 0||e===null)return;let t=()=>{re(Ut,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Ut,V]);let[Wt,Gt]=(0,j.useState)(!1),Kt=Ht||Wt;(0,j.useEffect)(()=>{!Kt&&Vt.current&&(Vt.current=!1,J.current=!1,r(!1))},[Kt]);let qt=e=>{if(G.current+=1,U(!1),W===`share`){v(e);return}d(e)},X=e=>{J.current!==e&&(J.current=e,r(e))},Z=q!==null&&P===null&&!I,Jt=(0,j.useRef)(Z);(0,j.useEffect)(()=>{Jt.current&&!Z&&(K(!1),X(!1)),Jt.current=Z},[Z]);let Yt=he(q),Xt=Z?de(q,e(`companionIntro.call.line`)):null,Zt=ye(Z?q:null),Q=pe(Zt),Qt=Z&&!Q&&(q===`talk`||q===`try`),$t=Z&&q===`idle`&&mt;(0,j.useEffect)(()=>{$t&&g(`next`)},[$t]);let[en,tn]=(0,j.useState)(!1);(0,j.useEffect)(()=>{tn(!1)},[q]);let nn=()=>{q===`try`&&!Q&&g(`try`)},$=Xt!==null,rn=P!==null||I?`call`:L===void 0?z===void 0?R?`watching`:We===void 0?Yt??(mt?`hover`:`resting`):`summary`:`offer`:`dictating`,an=e=>{if(Y.current!==null&&e.buttons===0&&(Y.current=null,h()),Y.current!==null){let{x:t,y:n}=Y.current;te(e.screenX-t,e.screenY-n),Y.current={x:e.screenX,y:e.screenY};let r=Mt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Fe&&(Nt.current=!0);return}let t=wt.current;if(!t)return;let n=St.current?.getBoundingClientRect()??null,r=Ct.current?.getBoundingClientRect()??null,i=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,a=Te({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:i}),o=Tt.current,s=o!==null&&k(o.getBoundingClientRect(),e.clientX,e.clientY),c=Dt.current,ee=c!==null&&k(c.getBoundingClientRect(),e.clientX,e.clientY),l=Et.current,u=l!==null&&k(l.getBoundingClientRect(),e.clientX,e.clientY),d=Ot.current,f=d!==null&&k(d.getBoundingClientRect(),e.clientX,e.clientY),p=kt.current,m=p!==null&&k(p.getBoundingClientRect(),e.clientX,e.clientY);K(a),At.current=m,Vt.current=f,X(a||s||u||ee||m||f)},on=be(P,Ae,Oe),sn=B===void 0||V!==`deferred`?0:B.kind===`approvals`?B.items.length:1;return(0,M.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:an,onMouseUp:()=>{Y.current!==null&&(Y.current=null,h())},onPointerCancel:()=>{Y.current!==null&&(Y.current=null,h()),K(!1),X(!1)},onMouseLeave:()=>{Y.current===null&&(K(!1),X(!1))},children:(0,M.jsx)(ve,{phase:rn,growth:i,cardGrowth:C,dock:E,avatarBox:O,optionsBox:A,avatarSrc:De,character:Oe,hovered:mt,accentHex:on,call:P??Xt?.call??void 0,assistantName:ze,dictating:L,dictationText:Le,working:Ve,watching:R,watchRetro:We,onWatchRetro:o,dictationOffer:z,offer:z===void 0?null:(0,M.jsx)(fe,{offer:z,growth:i,cardGrowth:C,avatarBox:O,optionsBox:A,cardRef:Dt,onAnswer:e=>{ce(e,z.id)}}),watchEnabled:Ye,spotlight:_e(q),avatarStaged:Qt,avatarTucked:Z&&q===`idle`,intro:!Z||q===null?null:(0,M.jsx)(me,{beat:q,growth:i,cardGrowth:C,avatarBox:O,optionsBox:A,accentHex:on,assistantName:ze===``?void 0:ze,cardRef:Tt,permission:Zt,greeted:en,voiceKeyTaps:gt,chordPresses:vt,chordControl:bt,onAdvance:e=>{if(e===`try`){nn();return}g(e)}}),rootRef:St,restingPillRef:Ct,avatarRef:wt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),Y.current={x:e.screenX,y:e.screenY},Mt.current={x:e.screenX,y:e.screenY},Nt.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),y())},onAvatarClick:()=>{if(!(Nt.current||$)){if(q!==null){Z&&!Q&&(q===`talk`?tn(!0):q===`try`&&nn());return}if(P!==null||I){w();return}c()}},onWatch:()=>{$||d()},onTeach:$?void 0:zt,picking:H&&W===`teach`,sharing:Xt?.sharing??Ft,shareEnabled:$||tt,sharePicking:H&&W===`share`,onShare:$?void 0:Bt,onStopShare:$?void 0:()=>{v()},annotating:rt,onAnnotate:$?void 0:e=>{u(e)},marked:st&&(at||rt),onClearMarks:$?void 0:()=>{ne()},openPicker:B?.kind===`microphones`?B.kind:void 0,onPicker:!$&&S()?e=>{oe(e)}:void 0,annotationTool:lt,onAnnotationTool:$?void 0:e=>{p(e)},drawToolsRef:jt,shortcuts:$?ge:It,picker:H?(0,M.jsx)(Me,{sources:ft,captureThumbnail:a,cardGrowth:C,side:(P!==null||I)&&(E===`left`||E===`right`)?E===`left`?`right`:`left`:void 0,avatarBox:O,optionsBox:A,cardRef:Et,label:W===`share`?e(`companionSurface.sharePicker`):void 0,onPick:qt,onAllowScreenRecording:()=>{(Ce()?we(`screen`):ae(`screen`)).catch(()=>void 0)}}):null,prompt:!Ht||B===void 0?null:V===`row`&&(B.kind===`approvals`||B.kind===`secret`)?(0,M.jsx)(xe,{popover:B,onAnswer:e=>{_(e,B.id)},onView:e=>{l(B.id,e)}}):(0,M.jsx)(Se,{attached:!0,popover:B,view:V??`expanded`,style:{maxHeight:Ie},onAnswer:e=>{_(e,B.id)},onView:e=>{l(B.id,e)},onOpenLink:e=>{m(e)}},B.id),promptRef:Ot,onWorkShelfChange:Gt,promptsDeferred:sn,onReviewPrompts:()=>{B!==void 0&&l(B.id,`expanded`)},onControl:$?void 0:(e,n)=>{t(n===void 0?{action:e}:{action:e,requestId:n})}})})}export{Le as CompanionSurfacePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BS as t,CC as n,Lc as r,Qg as i,ic as a}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BS as t,CC as n,Lc as r,Qg as i,ic as a}from"./app-BNxKtvfM.js";import{t as o,x as s}from"./react-BJ4PZBJN.js";import{w as c}from"./vendor-CezcraPH.js";import{Mn as l,Ra as u,Ya as d,i as f}from"./icons-Dwi7aA1Y.js";import{i as p,t as m}from"./companion-surface-BheNXy_6.js";var h=d(`monitor-up`,[[`path`,{d:`m9 10 3-3 3 3`,key:`11gsxs`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),g=d(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),_=e(s(),1),v=o(),y=i(`avatar`,`small`),b=i(`options`,`small`);function x({avatar:e,assistantName:i,open:o,onStart:s,onDismiss:d}){let{t:x}=c(),C=(0,_.useRef)(null),w=e?r(e.customImageUrl,e.components,e.traits,y):null;return(0,v.jsx)(t.Root,{open:o,onOpenChange:e=>{e||d()},children:(0,v.jsx)(t.Content,{ref:C,size:`lg`,hideCloseButton:!0,dismissOnOverlayClick:!1,onOpenAutoFocus:e=>{e.preventDefault(),C.current?.focus()},onEscapeKeyDown:e=>{e.preventDefault(),d()},className:`max-w-[820px] overflow-hidden`,style:a(e?.accentHex),children:(0,v.jsxs)(`div`,{className:`relative grid min-h-[500px] md:grid-cols-[1.18fr_0.82fr]`,children:[(0,v.jsx)(`button`,{type:`button`,"aria-label":x(`companionIntro.announcement.close`),className:`absolute top-4 right-4 z-10 flex size-8 items-center justify-center rounded-full text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-active)] hover:text-[var(--content-default)] md:text-white/60 md:hover:bg-white/10 md:hover:text-white`,onClick:d,children:(0,v.jsx)(f,{className:`size-4`})}),(0,v.jsxs)(`div`,{className:`relative flex min-w-0 flex-col p-8 sm:p-10`,children:[(0,v.jsx)(t.Title,{className:`[&>span]:whitespace-normal pr-8 text-[32px] leading-[1.08] tracking-[0.01em]`,children:x(`companionIntro.announcement.title`)}),(0,v.jsx)(t.Description,{className:`mt-3 max-w-[420px] text-body-medium-lighter leading-6 text-[var(--content-secondary)]`,children:x(`companionIntro.announcement.body`)}),(0,v.jsxs)(`div`,{className:`mt-6 flex flex-col gap-2`,children:[(0,v.jsx)(S,{icon:l,title:x(`companionIntro.announcement.cards.flow.title`),body:x(`companionIntro.announcement.cards.flow.body`)}),(0,v.jsx)(S,{icon:h,title:x(`companionIntro.announcement.cards.context.title`),body:x(`companionIntro.announcement.cards.context.body`)}),(0,v.jsx)(S,{icon:g,title:x(`companionIntro.announcement.cards.together.title`),body:x(`companionIntro.announcement.cards.together.body`)})]}),(0,v.jsx)(`div`,{className:`mt-auto flex justify-end pt-8`,children:(0,v.jsx)(n,{variant:`primary`,rightIcon:(0,v.jsx)(u,{className:`size-4`}),onClick:s,children:x(`companionIntro.announcement.start`)})})]}),(0,v.jsxs)(`div`,{className:`relative hidden min-h-[500px] overflow-hidden bg-[#17191d] md:block`,"aria-label":x(`companionIntro.announcement.previewLabel`),children:[(0,v.jsx)(`div`,{className:`absolute inset-0 opacity-80`,style:{background:`radial-gradient(circle at 68% 22%, color-mix(in srgb, ${e?.accentHex??`var(--content-tertiary)`} 20%, transparent), transparent 34%), linear-gradient(145deg, #252a32 0%, #15171b 72%)`}}),(0,v.jsxs)(`div`,{className:`absolute top-20 right-8 left-8 h-60 overflow-hidden rounded-xl border border-white/10 bg-white/8 shadow-2xl shadow-black/30`,children:[(0,v.jsxs)(`div`,{className:`flex h-8 items-center gap-1.5 border-b border-white/8 px-3`,children:[(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/20`}),(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/15`}),(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/10`})]}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 p-5`,children:[(0,v.jsx)(`span`,{className:`h-2.5 w-2/3 rounded-full bg-white/13`}),(0,v.jsx)(`span`,{className:`h-2.5 w-full rounded-full bg-white/8`}),(0,v.jsx)(`span`,{className:`h-2.5 w-5/6 rounded-full bg-white/8`}),(0,v.jsx)(`span`,{className:`mt-3 h-20 rounded-lg bg-white/6`})]})]}),(0,v.jsx)(`div`,{className:`absolute inset-x-0 bottom-16 h-48`,inert:!0,children:(0,v.jsx)(m,{phase:`call`,call:p(x(`companionIntro.call.line`)),shareEnabled:!0,sharing:!0,assistantName:i??x(`companionIntro.announcement.previewAssistantName`),accentHex:e?.accentHex??void 0,character:w?.kind===`character`?w.traits:void 0,avatarSrc:w?.kind===`image`?w.url:void 0,avatarBox:y,optionsBox:b})})]})]})})})}function S({icon:e,title:t,body:n}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,v.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--avatar-accent,var(--surface-lift))_28%,var(--surface-base))] text-[var(--content-default)]`,children:(0,v.jsx)(e,{className:`size-4`})}),(0,v.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,v.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:t}),(0,v.jsx)(`span`,{className:`text-body-small-default leading-5 text-[var(--content-tertiary)]`,children:n})]})]})}export{x as CompanionTourEntryModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Cl as n,Fl as r,Kl as i,Ug as a,Wg as o,zl as s}from"./app-CGffgaON.js";import{t as c,x as l}from"./react-BJ4PZBJN.js";import{w as u}from"./vendor-CezcraPH.js";import{n as d}from"./companion-accent-BnQ_HHAs.js";var f=e(l(),1);function p(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function m(e,t){return Math.round(e*1e3)*73856093^Math.round(t*1e3)*19349663}function h(e,t){if(e.length<2)return``;let n=n=>t?e[(n+e.length)%e.length]:e[Math.min(Math.max(n,0),e.length-1)],r=n(0),i=`M ${g(r.x)} ${g(r.y)}`,a=t?e.length:e.length-1;for(let e=0;e<a;e+=1){let t=n(e-1),r=n(e),a=n(e+1),o=n(e+2),s={x:r.x+(a.x-t.x)/6,y:r.y+(a.y-t.y)/6},c={x:a.x-(o.x-r.x)/6,y:a.y-(o.y-r.y)/6};i+=` C ${g(s.x)} ${g(s.y)}, ${g(c.x)} ${g(c.y)}, ${g(a.x)} ${g(a.y)}`}return t?`${i} Z`:i}function g(e){return Math.round(e*100)/100}var _=.09,v=.05,y=.028;function b(e){return Math.min(Math.max(e,0),_)}var x=1.5;x-Math.SQRT2*(x-1);function S(e,t){let n=Math.min(t*x,Math.min(e.width,e.height)/2+t),r=n-t,i=r,a=e.width-r,o=r,s=e.height-r,c={x:Math.max(a-i,0),y:Math.max(s-o,0)},l=Math.PI*n/2,u=[l,c.x,l,c.y,l,c.x,l,c.y],d=u.reduce((e,t)=>e+t,0),f=[{centre:{x:i,y:o},from:Math.PI},{centre:{x:a,y:o},from:-Math.PI/2},{centre:{x:a,y:s},from:0},{centre:{x:i,y:s},from:Math.PI/2}];return{at:e=>{let t=e%1*d;t<0&&(t+=d);for(let e=0;e<u.length;e+=1){let r=u[e];if(t>r&&e<u.length-1){t-=r;continue}let c=r===0?0:Math.min(t/r,1),l=f[e/2];if(e%2==0){let e=l.from+Math.PI/2*c;return{x:l.centre.x+Math.cos(e)*n,y:l.centre.y+Math.sin(e)*n}}let[d,p]=[[{x:i,y:o-n},{x:a,y:o-n}],[{x:a+n,y:o},{x:a+n,y:s}],[{x:a,y:s+n},{x:i,y:s+n}],[{x:i-n,y:s},{x:i-n,y:o}]][(e-1)/2];return{x:d.x+(p.x-d.x)*c,y:d.y+(p.y-d.y)*c}}return{x:0,y:0}},length:d}}function C(e,t){let n=t.padding??8,r={x:e.width/2,y:e.height/2},i=S(e,n),a=b(t.strength),o=p(t.seed),s=[];for(let e=0;e<=13;e+=1){let t=i.at(.18+1.055*e/13),n={x:t.x-r.x,y:t.y-r.y},c=Math.hypot(n.x,n.y)||1,l=o()*a*c;s.push({x:t.x+n.x/c*l,y:t.y+n.y/c*l})}return s}function w(e,t){return h(C(e,t),!1)}function T(e){let t=e.gap??10,n=b(e.strength),r=p(e.seed),i=e.length+t,a=Math.max(28,e.length*.55),o=a/2,s={x:o,y:i},c={x:o,y:t},l=r()<.5?-1:1,u=a*.17*l,d=e=>({x:(1-e)*(1-e)*s.x+2*(1-e)*e*(o+u)+e*e*c.x,y:(1-e)*(1-e)*s.y+2*(1-e)*e*((s.y+c.y)/2)+e*e*c.y}),f=[];for(let e=0;e<=9;e+=1){let t=e/9,i=d(t),o=(1-t)*(1-t),s=(r()-.5)*2*n*a*o;f.push({x:i.x+s,y:i.y})}let m=d(1-1/9),_=Math.atan2(c.y-m.y,c.x-m.x),v=Math.max(11,e.length*.3),y=.42,x=`M ${g(c.x+Math.cos(_-Math.PI+y)*v)} ${g(c.y+Math.sin(_-Math.PI+y)*v)} L ${g(c.x)} ${g(c.y)} L ${g(c.x+Math.cos(_-Math.PI-y)*v)} ${g(c.y+Math.sin(_-Math.PI-y)*v)}`;return{shaft:h(f,!1),head:x,width:a,height:i}}function E(){let[e,t]=(0,f.useState)(()=>({width:typeof window>`u`?0:window.innerWidth,height:typeof window>`u`?0:window.innerHeight}));return(0,f.useEffect)(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e}var D=c(),O=.6,k=10,A=52,j=10,M=A+j,N=10,P=8;function F(e,t){let n=e.kind===`point`?M:0,r=e.kind===`point`?e.y:e.y+e.height,i=e.kind===`point`?0:e.width,a=(1-r)*t-n,o=e.y*t-n;return{above:a<58&&o>a,trailing:e.x+i>O}}function I(e,t,n){let r=n?1-e.y:e.kind===`point`?e.y:e.y+e.height,i=Math.max(t-58,0),a=e.kind===`point`?A:0;return Math.round(Math.min(r*t+a+k,i))}function L(e){let t=Math.min(Math.max(e,0),1)*100;return`${Number(t.toFixed(4))}%`}function R(e){let t=e.kind===`region`?`${e.width},${e.height}`:`point`;return`${e.kind},${e.x},${e.y},${t},${e.caption??``}`}function z({mark:e,box:t}){let n=Math.max(e.width*t.width,1),r=Math.max(e.height*t.height,1),i=N+P,a=w({width:n,height:r},{strength:v,seed:m(e.x,e.y),padding:N});return(0,D.jsxs)(`svg`,{className:`companion-coachmark`,"data-testid":`companion-coachmark`,"aria-hidden":`true`,viewBox:`${-i} ${-i} ${n+i*2} ${r+i*2}`,width:n+i*2,height:r+i*2,style:{left:Math.round(e.x*t.width-i),top:Math.round(e.y*t.height-i)},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:a}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:a})]})}function B({mark:e,above:t,box:n}){let r=T({length:A,approach:t?`above`:`below`,strength:y,seed:m(e.x,e.y),gap:j});return(0,D.jsxs)(`svg`,{className:`companion-coachmark-pointer`,"data-testid":`companion-coachmark-pointer`,"data-above":t?``:void 0,"aria-hidden":`true`,viewBox:`0 0 ${r.width} ${r.height}`,width:r.width,height:r.height,style:{left:Math.round(e.x*n.width-r.width/2),top:Math.round(e.y*n.height-(t?r.height:0)),...t?{"--companion-coachmark-turn":`rotate(180deg)`}:{}},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.head}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.head})]})}function V({marks:e,ink:t}){let n=E();return(0,D.jsx)(`div`,{className:`pointer-events-none fixed inset-0`,"data-testid":`companion-coachmarks`,style:{"--companion-ring-accent":t},role:`presentation`,children:e.map(e=>{let{above:t,trailing:r}=F(e,n.height),i=`${I(e,n.height,t)}px`;return(0,D.jsxs)(f.Fragment,{children:[e.kind===`region`?(0,D.jsx)(z,{mark:e,box:n}):(0,D.jsx)(B,{mark:e,above:t,box:n}),e.caption!==void 0&&e.caption!==``&&(0,D.jsx)(`div`,{className:`companion-coachmark-caption`,"data-testid":`companion-coachmark-caption`,"data-above":t?``:void 0,"data-trailing":r?``:void 0,style:{...r?{right:L(1-(e.kind===`region`?e.x+e.width:e.x))}:{left:L(e.x)},...t?{bottom:i}:{top:i},maxWidth:L(.4)},children:e.caption})]},R(e))})})}var H=4500,U=e=>Math.min(Math.max(e,0),1);function W(e,t,n){switch(e){case`line`:return[t,n];case`box`:return[t,{x:n.x,y:t.y},n,{x:t.x,y:n.y},t];case`circle`:{let e=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.abs(n.x-t.x)/2,a=Math.abs(n.y-t.y)/2;return Array.from({length:49},(t,n)=>{let o=n/48*Math.PI*2;return{x:e+i*Math.cos(o),y:r+a*Math.sin(o)}})}}}function G(e,t,n){let r=(t.x-e.x)*n,i=t.y-e.y;return r*r+i*i>=a**2}var K=`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>`;function q(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><g stroke="#ffffff" stroke-width="4">${K}</g><g stroke="${e}" stroke-width="2">${K}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(t)}") 2 22, crosshair`}function J({ink:e,cleared:t=0,tool:r=`freehand`}){let[i,a]=(0,f.useState)([]),c=(0,f.useRef)([]),l=(0,f.useRef)(null),u=(0,f.useRef)({x:0,y:0}),d=(0,f.useRef)(!1),p=(0,f.useRef)(0),m=(0,f.useRef)(new Set),h=E(),g=h.height===0?1:h.width/h.height,_=(0,f.useRef)(e);(0,f.useEffect)(()=>{_.current=e},[e]),(0,f.useEffect)(()=>{let e=m.current;return()=>{for(let t of e)clearTimeout(t);e.clear(),l.current!==null&&(l.current=null,n(`released`,[],_.current))}},[]);let v=(0,f.useCallback)(e=>{c.current=e,a(e)},[]),y=(0,f.useRef)(t);(0,f.useEffect)(()=>{t!==y.current&&(y.current=t,v(c.current.filter(e=>e.id===l.current)))},[t,v]);let b=e=>({x:h.width===0?0:U(e.clientX/h.width),y:h.height===0?0:U(e.clientY/h.height)}),x=()=>{l.current===null&&(d.current=!0,s(!0))},S=()=>{d.current&&(d.current=!1,s(!1))},C=t=>{if(S(),l.current!==null)return;t.currentTarget.setPointerCapture(t.pointerId);let r=p.current++;l.current=r;let i=b(t);u.current=i,v([...c.current,{id:r,points:[i],spent:!1}]),n(`drawing`,[],e)},w=e=>{S();let t=l.current;if(t===null)return;let n=b(e),i=c.current.find(e=>e.id===t);if(i===void 0)return;let a=i.points[i.points.length-1];a!==void 0&&!G(a,n,g)||v(c.current.map(e=>e.id===t?{...e,points:r===`freehand`?[...e.points,n].slice(-512):W(r,u.current,n)}:e))},T=t=>{if(l.current===null)return;l.current=null,t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId);let r=c.current.map(e=>({...e,spent:!0}));v(r),n(`released`,r.slice(-24).map(e=>({points:e.points})),e);let i=new Set(r.map(e=>e.id)),a=setTimeout(()=>{m.current.delete(a),v(c.current.filter(e=>!i.has(e.id)))},H+900);m.current.add(a)},O=o*Math.min(h.width,h.height),k=(0,f.useMemo)(()=>q(e),[e]);return(0,D.jsx)(`svg`,{className:`companion-share-annotation fixed inset-0 h-full w-full`,style:{cursor:r===`freehand`?k:`crosshair`,"--companion-ink-hold":`${H}ms`,"--companion-ink-fade":`900ms`},"data-testid":`companion-share-annotation`,"data-cleared":t,"data-tool":r,role:`presentation`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,onWheel:x,children:i.map(t=>(0,D.jsx)(Y,{stroke:t,box:h,width:O,ink:e},t.id))})}function Y({stroke:e,box:t,width:n,ink:r}){let i=e.spent?`companion-share-ink companion-share-ink-spent`:`companion-share-ink`,a=e.points[0];return e.points.length===1&&a!==void 0?(0,D.jsx)(`circle`,{className:i,cx:a.x*t.width,cy:a.y*t.height,r:n/2,fill:r}):(0,D.jsx)(`polyline`,{className:i,points:e.points.map(e=>`${e.x*t.width},${e.y*t.height}`).join(` `),fill:`none`,stroke:r,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`})}function X(e,t){return e?{kind:`teaching`}:t===void 0?null:{kind:`sharing`,target:t}}function Z({read:e,assistantName:t,style:n}){let{t:r}=u(),i=t!==``,a=e.kind===`teaching`?i?r(`companionWatchFramePage.teachingNamed`,{name:t}):r(`companionWatchFramePage.teaching`):e.target.kind===`display`?i?r(`companionWatchFramePage.sharingScreenNamed`,{name:t}):r(`companionWatchFramePage.sharingScreen`):i?r(`companionWatchFramePage.sharingWindowNamed`,{name:t}):r(`companionWatchFramePage.sharingWindow`);return(0,D.jsxs)(`div`,{className:`companion-watch-frame-label`,"data-testid":`companion-watch-frame-label`,"data-read":e.kind,style:n,children:[(0,D.jsx)(`span`,{className:`companion-watch-frame-label-dot`}),a]})}function Q(e,t){let n=(0,f.useRef)({captureCount:e,watching:t}),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{let r=n.current;if(n.current={captureCount:e,watching:t},!t){i(0);return}r.watching&&e>r.captureCount&&i(e=>e+1)},[e,t]),r}function $(e){let t=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!e||t.current)return;let n=0,i=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t.current=!0,r()})});return()=>{cancelAnimationFrame(i),cancelAnimationFrame(n)}},[e])}function ee(){let[e,n]=(0,f.useState)(null);(0,f.useEffect)(()=>{let e=i(n);return t().then(e=>{e&&n(e)}),e},[]);let r=e?.watching===!0,a=e?.screenShare!==void 0,o=X(r,e?.screenShare),s=o!==null;$(s);let c=Q(e?.captureCount??0,r),l=d(e?.call??null,e?.accentHex,e?.character),u=l===void 0?void 0:{"--companion-ring-accent":l},p=e?.frameInsetTop??0,m=p>0?{...u,"--companion-frame-inset":`${p}px`}:u,h=e?.annotating===!0,g=a&&!r?e?.coachmarks??[]:[];return(0,D.jsxs)(`div`,{className:`pointer-events-none h-screen w-screen bg-transparent`,role:`presentation`,"aria-hidden":!0,children:[s&&(0,D.jsx)(`div`,{className:`companion-watch-frame fixed inset-0`,style:u}),o!==null&&(0,D.jsx)(Z,{read:o,assistantName:e?.assistantName??``,style:m}),r&&c>0&&(0,D.jsx)(`div`,{className:`companion-watch-frame-flash fixed inset-0`,style:u},c),h&&(0,D.jsx)(J,{ink:l??`#5eead4`,cleared:e?.marksCleared??0,tool:e?.annotationTool}),g.length>0&&(0,D.jsx)(V,{marks:g,ink:l??`#5eead4`})]})}export{ee as CompanionWatchFramePage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Al as t,Cl as n,Fl as r,Kl as i,Ug as a,Wg as o,zl as s}from"./app-BNxKtvfM.js";import{t as c,x as l}from"./react-BJ4PZBJN.js";import{w as u}from"./vendor-CezcraPH.js";import{n as d}from"./companion-accent-DNqagkeK.js";var f=e(l(),1);function p(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function m(e,t){return Math.round(e*1e3)*73856093^Math.round(t*1e3)*19349663}function h(e,t){if(e.length<2)return``;let n=n=>t?e[(n+e.length)%e.length]:e[Math.min(Math.max(n,0),e.length-1)],r=n(0),i=`M ${g(r.x)} ${g(r.y)}`,a=t?e.length:e.length-1;for(let e=0;e<a;e+=1){let t=n(e-1),r=n(e),a=n(e+1),o=n(e+2),s={x:r.x+(a.x-t.x)/6,y:r.y+(a.y-t.y)/6},c={x:a.x-(o.x-r.x)/6,y:a.y-(o.y-r.y)/6};i+=` C ${g(s.x)} ${g(s.y)}, ${g(c.x)} ${g(c.y)}, ${g(a.x)} ${g(a.y)}`}return t?`${i} Z`:i}function g(e){return Math.round(e*100)/100}var _=.09,v=.05,y=.028;function b(e){return Math.min(Math.max(e,0),_)}var x=1.5;x-Math.SQRT2*(x-1);function S(e,t){let n=Math.min(t*x,Math.min(e.width,e.height)/2+t),r=n-t,i=r,a=e.width-r,o=r,s=e.height-r,c={x:Math.max(a-i,0),y:Math.max(s-o,0)},l=Math.PI*n/2,u=[l,c.x,l,c.y,l,c.x,l,c.y],d=u.reduce((e,t)=>e+t,0),f=[{centre:{x:i,y:o},from:Math.PI},{centre:{x:a,y:o},from:-Math.PI/2},{centre:{x:a,y:s},from:0},{centre:{x:i,y:s},from:Math.PI/2}];return{at:e=>{let t=e%1*d;t<0&&(t+=d);for(let e=0;e<u.length;e+=1){let r=u[e];if(t>r&&e<u.length-1){t-=r;continue}let c=r===0?0:Math.min(t/r,1),l=f[e/2];if(e%2==0){let e=l.from+Math.PI/2*c;return{x:l.centre.x+Math.cos(e)*n,y:l.centre.y+Math.sin(e)*n}}let[d,p]=[[{x:i,y:o-n},{x:a,y:o-n}],[{x:a+n,y:o},{x:a+n,y:s}],[{x:a,y:s+n},{x:i,y:s+n}],[{x:i-n,y:s},{x:i-n,y:o}]][(e-1)/2];return{x:d.x+(p.x-d.x)*c,y:d.y+(p.y-d.y)*c}}return{x:0,y:0}},length:d}}function C(e,t){let n=t.padding??8,r={x:e.width/2,y:e.height/2},i=S(e,n),a=b(t.strength),o=p(t.seed),s=[];for(let e=0;e<=13;e+=1){let t=i.at(.18+1.055*e/13),n={x:t.x-r.x,y:t.y-r.y},c=Math.hypot(n.x,n.y)||1,l=o()*a*c;s.push({x:t.x+n.x/c*l,y:t.y+n.y/c*l})}return s}function w(e,t){return h(C(e,t),!1)}function T(e){let t=e.gap??10,n=b(e.strength),r=p(e.seed),i=e.length+t,a=Math.max(28,e.length*.55),o=a/2,s={x:o,y:i},c={x:o,y:t},l=r()<.5?-1:1,u=a*.17*l,d=e=>({x:(1-e)*(1-e)*s.x+2*(1-e)*e*(o+u)+e*e*c.x,y:(1-e)*(1-e)*s.y+2*(1-e)*e*((s.y+c.y)/2)+e*e*c.y}),f=[];for(let e=0;e<=9;e+=1){let t=e/9,i=d(t),o=(1-t)*(1-t),s=(r()-.5)*2*n*a*o;f.push({x:i.x+s,y:i.y})}let m=d(1-1/9),_=Math.atan2(c.y-m.y,c.x-m.x),v=Math.max(11,e.length*.3),y=.42,x=`M ${g(c.x+Math.cos(_-Math.PI+y)*v)} ${g(c.y+Math.sin(_-Math.PI+y)*v)} L ${g(c.x)} ${g(c.y)} L ${g(c.x+Math.cos(_-Math.PI-y)*v)} ${g(c.y+Math.sin(_-Math.PI-y)*v)}`;return{shaft:h(f,!1),head:x,width:a,height:i}}function E(){let[e,t]=(0,f.useState)(()=>({width:typeof window>`u`?0:window.innerWidth,height:typeof window>`u`?0:window.innerHeight}));return(0,f.useEffect)(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e}var D=c(),O=.6,k=10,A=52,j=10,M=A+j,N=10,P=8;function F(e,t){let n=e.kind===`point`?M:0,r=e.kind===`point`?e.y:e.y+e.height,i=e.kind===`point`?0:e.width,a=(1-r)*t-n,o=e.y*t-n;return{above:a<58&&o>a,trailing:e.x+i>O}}function I(e,t,n){let r=n?1-e.y:e.kind===`point`?e.y:e.y+e.height,i=Math.max(t-58,0),a=e.kind===`point`?A:0;return Math.round(Math.min(r*t+a+k,i))}function L(e){let t=Math.min(Math.max(e,0),1)*100;return`${Number(t.toFixed(4))}%`}function R(e){let t=e.kind===`region`?`${e.width},${e.height}`:`point`;return`${e.kind},${e.x},${e.y},${t},${e.caption??``}`}function z({mark:e,box:t}){let n=Math.max(e.width*t.width,1),r=Math.max(e.height*t.height,1),i=N+P,a=w({width:n,height:r},{strength:v,seed:m(e.x,e.y),padding:N});return(0,D.jsxs)(`svg`,{className:`companion-coachmark`,"data-testid":`companion-coachmark`,"aria-hidden":`true`,viewBox:`${-i} ${-i} ${n+i*2} ${r+i*2}`,width:n+i*2,height:r+i*2,style:{left:Math.round(e.x*t.width-i),top:Math.round(e.y*t.height-i)},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:a}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:a})]})}function B({mark:e,above:t,box:n}){let r=T({length:A,approach:t?`above`:`below`,strength:y,seed:m(e.x,e.y),gap:j});return(0,D.jsxs)(`svg`,{className:`companion-coachmark-pointer`,"data-testid":`companion-coachmark-pointer`,"data-above":t?``:void 0,"aria-hidden":`true`,viewBox:`0 0 ${r.width} ${r.height}`,width:r.width,height:r.height,style:{left:Math.round(e.x*n.width-r.width/2),top:Math.round(e.y*n.height-(t?r.height:0)),...t?{"--companion-coachmark-turn":`rotate(180deg)`}:{}},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.head}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.head})]})}function V({marks:e,ink:t}){let n=E();return(0,D.jsx)(`div`,{className:`pointer-events-none fixed inset-0`,"data-testid":`companion-coachmarks`,style:{"--companion-ring-accent":t},role:`presentation`,children:e.map(e=>{let{above:t,trailing:r}=F(e,n.height),i=`${I(e,n.height,t)}px`;return(0,D.jsxs)(f.Fragment,{children:[e.kind===`region`?(0,D.jsx)(z,{mark:e,box:n}):(0,D.jsx)(B,{mark:e,above:t,box:n}),e.caption!==void 0&&e.caption!==``&&(0,D.jsx)(`div`,{className:`companion-coachmark-caption`,"data-testid":`companion-coachmark-caption`,"data-above":t?``:void 0,"data-trailing":r?``:void 0,style:{...r?{right:L(1-(e.kind===`region`?e.x+e.width:e.x))}:{left:L(e.x)},...t?{bottom:i}:{top:i},maxWidth:L(.4)},children:e.caption})]},R(e))})})}var H=4500,U=e=>Math.min(Math.max(e,0),1);function W(e,t,n){switch(e){case`line`:return[t,n];case`box`:return[t,{x:n.x,y:t.y},n,{x:t.x,y:n.y},t];case`circle`:{let e=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.abs(n.x-t.x)/2,a=Math.abs(n.y-t.y)/2;return Array.from({length:49},(t,n)=>{let o=n/48*Math.PI*2;return{x:e+i*Math.cos(o),y:r+a*Math.sin(o)}})}}}function G(e,t,n){let r=(t.x-e.x)*n,i=t.y-e.y;return r*r+i*i>=a**2}var K=`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>`;function q(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><g stroke="#ffffff" stroke-width="4">${K}</g><g stroke="${e}" stroke-width="2">${K}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(t)}") 2 22, crosshair`}function J({ink:e,cleared:t=0,tool:r=`freehand`}){let[i,a]=(0,f.useState)([]),c=(0,f.useRef)([]),l=(0,f.useRef)(null),u=(0,f.useRef)({x:0,y:0}),d=(0,f.useRef)(!1),p=(0,f.useRef)(0),m=(0,f.useRef)(new Set),h=E(),g=h.height===0?1:h.width/h.height,_=(0,f.useRef)(e);(0,f.useEffect)(()=>{_.current=e},[e]),(0,f.useEffect)(()=>{let e=m.current;return()=>{for(let t of e)clearTimeout(t);e.clear(),l.current!==null&&(l.current=null,n(`released`,[],_.current))}},[]);let v=(0,f.useCallback)(e=>{c.current=e,a(e)},[]),y=(0,f.useRef)(t);(0,f.useEffect)(()=>{t!==y.current&&(y.current=t,v(c.current.filter(e=>e.id===l.current)))},[t,v]);let b=e=>({x:h.width===0?0:U(e.clientX/h.width),y:h.height===0?0:U(e.clientY/h.height)}),x=()=>{l.current===null&&(d.current=!0,s(!0))},S=()=>{d.current&&(d.current=!1,s(!1))},C=t=>{if(S(),l.current!==null)return;t.currentTarget.setPointerCapture(t.pointerId);let r=p.current++;l.current=r;let i=b(t);u.current=i,v([...c.current,{id:r,points:[i],spent:!1}]),n(`drawing`,[],e)},w=e=>{S();let t=l.current;if(t===null)return;let n=b(e),i=c.current.find(e=>e.id===t);if(i===void 0)return;let a=i.points[i.points.length-1];a!==void 0&&!G(a,n,g)||v(c.current.map(e=>e.id===t?{...e,points:r===`freehand`?[...e.points,n].slice(-512):W(r,u.current,n)}:e))},T=t=>{if(l.current===null)return;l.current=null,t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId);let r=c.current.map(e=>({...e,spent:!0}));v(r),n(`released`,r.slice(-24).map(e=>({points:e.points})),e);let i=new Set(r.map(e=>e.id)),a=setTimeout(()=>{m.current.delete(a),v(c.current.filter(e=>!i.has(e.id)))},H+900);m.current.add(a)},O=o*Math.min(h.width,h.height),k=(0,f.useMemo)(()=>q(e),[e]);return(0,D.jsx)(`svg`,{className:`companion-share-annotation fixed inset-0 h-full w-full`,style:{cursor:r===`freehand`?k:`crosshair`,"--companion-ink-hold":`${H}ms`,"--companion-ink-fade":`900ms`},"data-testid":`companion-share-annotation`,"data-cleared":t,"data-tool":r,role:`presentation`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,onWheel:x,children:i.map(t=>(0,D.jsx)(Y,{stroke:t,box:h,width:O,ink:e},t.id))})}function Y({stroke:e,box:t,width:n,ink:r}){let i=e.spent?`companion-share-ink companion-share-ink-spent`:`companion-share-ink`,a=e.points[0];return e.points.length===1&&a!==void 0?(0,D.jsx)(`circle`,{className:i,cx:a.x*t.width,cy:a.y*t.height,r:n/2,fill:r}):(0,D.jsx)(`polyline`,{className:i,points:e.points.map(e=>`${e.x*t.width},${e.y*t.height}`).join(` `),fill:`none`,stroke:r,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`})}function X(e,t){return e?{kind:`teaching`}:t===void 0?null:{kind:`sharing`,target:t}}function Z({read:e,assistantName:t,style:n}){let{t:r}=u(),i=t!==``,a=e.kind===`teaching`?i?r(`companionWatchFramePage.teachingNamed`,{name:t}):r(`companionWatchFramePage.teaching`):e.target.kind===`display`?i?r(`companionWatchFramePage.sharingScreenNamed`,{name:t}):r(`companionWatchFramePage.sharingScreen`):i?r(`companionWatchFramePage.sharingWindowNamed`,{name:t}):r(`companionWatchFramePage.sharingWindow`);return(0,D.jsxs)(`div`,{className:`companion-watch-frame-label`,"data-testid":`companion-watch-frame-label`,"data-read":e.kind,style:n,children:[(0,D.jsx)(`span`,{className:`companion-watch-frame-label-dot`}),a]})}function Q(e,t){let n=(0,f.useRef)({captureCount:e,watching:t}),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{let r=n.current;if(n.current={captureCount:e,watching:t},!t){i(0);return}r.watching&&e>r.captureCount&&i(e=>e+1)},[e,t]),r}function $(e){let t=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!e||t.current)return;let n=0,i=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t.current=!0,r()})});return()=>{cancelAnimationFrame(i),cancelAnimationFrame(n)}},[e])}function ee(){let[e,n]=(0,f.useState)(null);(0,f.useEffect)(()=>{let e=i(n);return t().then(e=>{e&&n(e)}),e},[]);let r=e?.watching===!0,a=e?.screenShare!==void 0,o=X(r,e?.screenShare),s=o!==null;$(s);let c=Q(e?.captureCount??0,r),l=d(e?.call??null,e?.accentHex,e?.character),u=l===void 0?void 0:{"--companion-ring-accent":l},p=e?.frameInsetTop??0,m=p>0?{...u,"--companion-frame-inset":`${p}px`}:u,h=e?.annotating===!0,g=a&&!r?e?.coachmarks??[]:[];return(0,D.jsxs)(`div`,{className:`pointer-events-none h-screen w-screen bg-transparent`,role:`presentation`,"aria-hidden":!0,children:[s&&(0,D.jsx)(`div`,{className:`companion-watch-frame fixed inset-0`,style:u}),o!==null&&(0,D.jsx)(Z,{read:o,assistantName:e?.assistantName??``,style:m}),r&&c>0&&(0,D.jsx)(`div`,{className:`companion-watch-frame-flash fixed inset-0`,style:u},c),h&&(0,D.jsx)(J,{ink:l??`#5eead4`,cleared:e?.marksCleared??0,tool:e?.annotationTool}),g.length>0&&(0,D.jsx)(V,{marks:g,ink:l??`#5eead4`})]})}export{ee as CompanionWatchFramePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,G as n,Gx as r,fC as i,uC as a,zS as o}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{CC as t,G as n,Gx as r,fC as i,uC as a,zS as o}from"./app-BNxKtvfM.js";import{_ as s,f as c,t as l,x as u}from"./react-BJ4PZBJN.js";import{Jn as d,er as f,w as p}from"./vendor-CezcraPH.js";import{D as m,tr as h}from"./icons-Dwi7aA1Y.js";import{n as g}from"./a2a-invite-QwLkdzoC.js";import{r as _}from"./contacts-gateway-FWhhciZa.js";var v=e(u(),1),y=l();function b(e){let t=e[0];return typeof t==`object`&&!!t&&t._id===`contactsGet`}function x(e){switch(e){case`expired`:case`not_found`:return`connectPage.errorExpired`;case`already_redeemed_by_other`:return`connectPage.errorAlreadyRedeemed`;case`sender_not_found`:return`connectPage.errorSenderNotFound`;case`not_platform_managed`:return`connectPage.errorNotPlatformManaged`;default:return null}}function S(){return(0,y.jsx)(C,{assistantId:n()})}function C({assistantId:e}){let{t:n}=p(`contacts`),l=c(),u=f(),[S]=s(),C=(0,v.useMemo)(()=>g(S),[S]),w=d({mutationFn:()=>{if(!C)throw Error(`Invalid invite link`);return _(e,{senderAssistantId:C.senderAssistantId,token:C.token})},onSuccess:e=>{e.success&&(u.invalidateQueries({predicate:e=>b(e.queryKey)}),e.alreadyConnected?o(n(`connectPage.alreadyConnected`)):o(n(`connectPage.connected`)),l(r.contacts.root))}}),T=(0,v.useCallback)(()=>{l(r.contacts.root)},[l]),E=(0,v.useCallback)(()=>{w.mutate()},[w]),D=(0,v.useMemo)(()=>{if(w.isError)return w.error instanceof Error?w.error.message:n(`connectPage.errorGeneric`);if(w.data&&!w.data.success){let e=x(w.data.errorCode);return e?n(e):w.data.error||n(`connectPage.errorGeneric`)}return null},[w.isError,w.error,w.data,n]);return C?(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(a,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(h,{className:`h-6 w-6`,style:{color:`var(--content-secondary)`}}),(0,y.jsx)(i,{variant:`title-small`,children:n(`connectPage.title`)})]}),(0,y.jsx)(i,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:n(`connectPage.body`)}),D&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md p-3`,style:{backgroundColor:`var(--system-negative-weak)`,color:`var(--system-negative-strong)`},children:[(0,y.jsx)(m,{className:`h-4 w-4 shrink-0`}),(0,y.jsx)(i,{variant:`body-small-default`,children:D})]}),(0,y.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,y.jsx)(t,{variant:`primary`,onClick:E,loading:w.isPending,disabled:w.isPending,children:w.isPending?n(`actions.connecting`):n(`actions.connect`)}),(0,y.jsx)(t,{variant:`outlined`,onClick:T,disabled:w.isPending,children:n(`actions.cancel`)})]})]})})}):(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(a,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(m,{className:`h-6 w-6`,style:{color:`var(--system-negative-strong)`}}),(0,y.jsx)(i,{variant:`title-small`,children:n(`connectPage.invalidTitle`)})]}),(0,y.jsx)(i,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:n(`connectPage.invalidBody`)}),(0,y.jsx)(`div`,{className:`flex gap-2 pt-2`,children:(0,y.jsx)(t,{variant:`primary`,onClick:T,children:n(`connectPage.goToContacts`)})})]})})})}export{S as ConnectPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fy as e,Gx as t,Wx as n,XS as r,uC as i}from"./app-
|
|
1
|
+
import{Fy as e,Gx as t,Wx as n,XS as r,uC as i}from"./app-BNxKtvfM.js";import{t as a}from"./react-BJ4PZBJN.js";import{E as o,w as s}from"./vendor-CezcraPH.js";import{t as c}from"./setting-row-3-QGMKbV.js";var l=a(),u=[`[&_button[data-state=checked]]:bg-[var(--primary-base)]`,`[&_svg]:text-[var(--content-inset)]`,`[&_button[data-state=unchecked]]:bg-[var(--surface-base)]`,`[&_button[data-state=unchecked]]:border-[var(--border-element)]`].join(` `),d=`mb-2.5 ml-1 text-body-small-default font-medium uppercase tracking-wider text-[var(--content-tertiary)]`,f={privacy:{href:t.docs.legal.privacyPolicy,text:`Privacy and AI Data Sharing Policy`,aria:`I agree to the Privacy and AI Data Sharing Policy`},tos:{href:t.docs.legal.termsOfUse,text:`Terms of Service`,aria:`I agree to the Terms of Service`}};function p({kind:t,checked:i,onChange:a}){let s=f[t];return(0,l.jsx)(r,{checked:i,onCheckedChange:e=>a(e===!0),label:(0,l.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:(0,l.jsx)(o,{i18nKey:`consentControls.agreeTo`,ns:`onboarding`,values:{policy:s.text},components:{link:(0,l.jsx)(e,{href:n(s.href),tone:`quiet`,glyph:!1})}})}),"aria-label":s.aria,className:u})}function m(){return(0,l.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function h({notes:e}){let{t}=s(`onboarding`);return!e||e.length===0?null:(0,l.jsxs)(`div`,{className:`rounded-r-md border-l-2 border-[var(--content-secondary)] bg-[var(--surface-base)] py-3 pl-3.5 pr-3.5`,children:[(0,l.jsx)(`p`,{className:`text-body-small-default font-medium text-[var(--content-secondary)]`,children:t(`consentControls.whatsChanged`)}),e.length===1?(0,l.jsx)(`p`,{className:`mt-1.5 text-body-medium-lighter text-[var(--content-default)]`,children:e[0]}):(0,l.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1.5`,children:e.map(e=>(0,l.jsxs)(`li`,{className:`flex gap-2.5 text-body-medium-lighter text-[var(--content-default)]`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`mt-[0.5em] h-1 w-1 flex-none rounded-full bg-[var(--content-tertiary)]`}),(0,l.jsx)(`span`,{children:e})]},e))})]})}function g({electron:e,showAnalytics:t=!0,showDiagnostics:n=!0,shareAnalytics:r,shareDiagnostics:a,onShareAnalyticsChange:o,onShareDiagnosticsChange:u,className:f,style:p}){let{t:h}=s(`onboarding`);return(0,l.jsxs)(`section`,{className:f,style:p,children:[(0,l.jsx)(`p`,{className:d,children:h(`consentControls.privacyPreferences`)}),(0,l.jsx)(i,{padding:e?`sm`:`md`,className:`w-full`,children:(0,l.jsxs)(`div`,{className:`flex flex-col ${e?`gap-3`:`gap-4`}`,children:[t&&(0,l.jsx)(c,{label:h(`consentControls.analyticsLabel`),helperText:h(`consentControls.analyticsHelp`),checked:r,onChange:o}),t&&n&&(0,l.jsx)(m,{}),n&&(0,l.jsx)(c,{label:h(`consentControls.diagnosticsLabel`),helperText:h(`consentControls.diagnosticsHelp`),checked:a,onChange:u})]})})]})}function _({electron:e,showPrivacy:t=!0,showTos:n=!0,privacyConsent:r,tosAccepted:i,onPrivacyChange:a,onTosChange:o,privacyNotes:c,tosNotes:u,className:f,style:m}){let{t:g}=s(`onboarding`);return(0,l.jsxs)(`section`,{className:f,style:m,children:[(0,l.jsx)(`p`,{className:d,children:g(`consentControls.agreements`)}),(0,l.jsxs)(`div`,{className:`flex flex-col pl-2 ${e?`gap-3.5`:`gap-4`}`,children:[t&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsx)(h,{notes:c}),(0,l.jsx)(p,{kind:`privacy`,checked:r,onChange:a})]}),n&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsx)(h,{notes:u}),(0,l.jsx)(p,{kind:`tos`,checked:i,onChange:o})]})]})]})}export{g as n,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$f as e,Qf as t,aS as n,cv as r,ep as i,iS as a,sS as o}from"./app-
|
|
1
|
+
import{$f as e,Qf as t,aS as n,cv as r,ep as i,iS as a,sS as o}from"./app-BNxKtvfM.js";async function s(e,t){let{data:r,error:s,response:c}=await i({path:{assistant_id:e},body:t,throwOnError:!1});if(n(c,s,`Failed to save contact`),!c.ok||!r?.contact)throw new a(c.status,o(s,c,`Failed to save contact`));return r.contact}async function c(t,r){let{error:i,response:s}=await e({path:{assistant_id:t,contact_id:r},throwOnError:!1});if(n(s,i,`Failed to delete contact`),!s.ok&&s.status!==204)throw new a(s.status,o(i,s,`Failed to delete contact`))}async function l(e,r){let{error:i,response:s}=await t({path:{assistant_id:e,channel_id:r},throwOnError:!1});if(n(s,i,`Failed to verify channel`),!s.ok)throw new a(s.status,o(i,s,`Failed to verify channel`))}async function u(e,t,n){let r=(await s(e,{id:t.id,displayName:t.displayName,channels:[{type:n.type,address:n.address}]})).channels.find(e=>e.type===n.type&&e.address.toLowerCase()===n.address.toLowerCase());if(!r)throw new a(409,`That account is already linked to another contact.`);if(r.status===`blocked`)throw new a(409,`That account is blocked for this contact. Unblock it before linking.`);await l(e,r.id)}async function d(e,t){let{data:i,error:s,response:c}=await r.post({url:`/v1/assistants/{assistant_id}/a2a/invites/redeem/`,path:{assistant_id:e},body:{sender_assistant_id:t.senderAssistantId,token:t.token},headers:{"Content-Type":`application/json`},throwOnError:!1});if(n(c,s,`Failed to redeem A2A invite`),!c.ok)throw new a(c.status,o(s,c,`Failed to redeem A2A invite`));return{success:i?.success??!0,alreadyConnected:i?.already_connected,error:i?.error,errorCode:i?.error_code}}export{l as a,s as i,u as n,d as r,c as t};
|