braian 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -7
- package/bin/braian.mjs +337 -60
- package/bin/launch-target.mjs +15 -27
- package/bin/run-state.mjs +203 -0
- package/dist/app.module.js +2 -0
- package/dist/bootstrap.js +4 -1
- package/dist/http/api-controllers.js +6 -0
- package/dist/http/vault-http-error.js +4 -1
- package/dist/http/web-app-fallback.js +37 -0
- package/dist/logging/logging.middleware.js +3 -1
- package/dist/main.js +3 -0
- package/dist/mcp/mcp-path.js +12 -0
- package/dist/mcp/mcp-settings.controller.js +78 -0
- package/dist/mcp/mcp.controller.js +147 -0
- package/dist/mcp/mcp.dto.js +53 -0
- package/dist/mcp/mcp.module.js +20 -0
- package/dist/mcp/mcp.service.js +117 -0
- package/dist/providers/model-provider.service.js +3 -3
- package/dist/rss/rss-profiles.controller.js +167 -0
- package/dist/rss/rss-profiles.dto.js +511 -0
- package/dist/rss/rss-profiles.service.js +149 -0
- package/dist/rss/rss.module.js +5 -2
- package/dist/search/search.controller.js +1 -1
- package/dist/vaults/vault.controller.js +41 -0
- package/dist/vaults/vault.dto.js +80 -6
- package/dist/vaults/vaults.module.js +2 -1
- package/dist/vaults/vaults.service.js +30 -2
- package/dist/workspace/workspace-config.js +3 -3
- package/node_modules/@braian/ai-providers/dist/index.js +4 -1
- package/node_modules/@braian/ai-providers/dist/jev-routing.js +41 -13
- package/node_modules/@braian/graph-agent/dist/agent-profiles/tool-catalog.js +4 -4
- package/node_modules/@braian/graph-agent/dist/data-workspace.js +44 -0
- package/node_modules/@braian/graph-agent/dist/demo-vaults.js +348 -0
- package/node_modules/@braian/graph-agent/dist/feature-switch.js +1 -1
- package/node_modules/@braian/graph-agent/dist/graph-agent.js +40 -7
- package/node_modules/@braian/graph-agent/dist/index.js +24 -2
- package/node_modules/@braian/graph-agent/dist/mcp-tokens.js +62 -0
- package/node_modules/@braian/graph-agent/dist/rss/index.js +43 -1
- package/node_modules/@braian/graph-agent/dist/rss/rss-profile-model.js +378 -0
- package/node_modules/@braian/graph-agent/dist/rss/rss-profile-store.js +170 -0
- package/node_modules/@braian/graph-agent/dist/rss/rss-profile-test.js +120 -0
- package/node_modules/@braian/graph-agent/dist/rss/rss-profile-use-cases.js +74 -0
- package/node_modules/@braian/graph-agent/dist/vault-changes.js +3 -0
- package/node_modules/@braian/graph-agent/dist/vault-settings-operations.js +3 -1
- package/node_modules/@braian/graph-agent/dist/vault-settings-registry.js +1 -1
- package/node_modules/@braian/voice-transcription/dist/transcribe.js +1 -1
- package/package.json +3 -1
- package/public/assets/{agent-profiles-settings-I5Ux2GnH.js → agent-profiles-settings-yElCnMJo.js} +1 -1
- package/public/assets/{appearance-settings-module-CD3bJpfR.js → appearance-settings-module-BFDKE-mZ.js} +1 -1
- package/public/assets/{ar-SA-G6X2FPQ2-BPq1dwIU.js → ar-SA-G6X2FPQ2-R9ND2Rw0.js} +1 -1
- package/public/assets/{attachment-embed-BkP-B_Pa.js → attachment-embed-BX0XSPNZ.js} +1 -1
- package/public/assets/{attachments-settings-BeAekkzf.js → attachments-settings-CSEjOoFg.js} +1 -1
- package/public/assets/{az-AZ-76LH7QW2-nXEHcVXP.js → az-AZ-76LH7QW2-DpGlptKS.js} +1 -1
- package/public/assets/{bg-BG-XCXSNQG7-CpTkmSSX.js → bg-BG-XCXSNQG7-WKBfRf7q.js} +1 -1
- package/public/assets/{bn-BD-2XOGV67Q-BDMEyCuA.js → bn-BD-2XOGV67Q-BmT7jnvl.js} +1 -1
- package/public/assets/board-workspace-CmetKvXF.js +1 -0
- package/public/assets/{boards-settings-module-CCN_ZNks.js → boards-settings-module-Bh5dh9jG.js} +1 -1
- package/public/assets/{boards-view-B1B8wHHn.js → boards-view-3JR36W_w.js} +1 -1
- package/public/assets/{ca-ES-6MX7JW3Y-D0UEot-K.js → ca-ES-6MX7JW3Y-CBR9ytrG.js} +1 -1
- package/public/assets/{calendar-view-BlTCcAzD.js → calendar-view-Cr1VSpj0.js} +1 -1
- package/public/assets/calendar-workspace-B-2Himdy.js +1 -0
- package/public/assets/{calendars-settings-module-ActBZM9v.js → calendars-settings-module-BWI1k_YA.js} +1 -1
- package/public/assets/{card-fields-nzhTsBAW.js → card-fields-eo7dqj1P.js} +1 -1
- package/public/assets/{chat-composer-editor-CRtsZz3W.js → chat-composer-editor-DCmWVP16.js} +1 -1
- package/public/assets/chat-message-list-DPXjDBw1.js +1 -0
- package/public/assets/{chunk-EIO257PC-CGqfS2j0.js → chunk-EIO257PC-Bfdsn_q8.js} +1 -1
- package/public/assets/{code-editor-DnrGU9QQ.js → code-editor-CxLqzVwa.js} +1 -1
- package/public/assets/color-picker-DK8V_DI0.js +1 -0
- package/public/assets/{contents-view-C6RdJxE2.js → contents-view-DHRWEBwV.js} +1 -1
- package/public/assets/{conversation-debug-panel-DIjQShXO.js → conversation-debug-panel-zsrBEMxW.js} +1 -1
- package/public/assets/create-note-popup-C9IB_IZr.js +1 -0
- package/public/assets/{cs-CZ-2BRQDIVT-DvEBYfBD.js → cs-CZ-2BRQDIVT-fiabtlu1.js} +1 -1
- package/public/assets/{cypher-editor-Cdd9vqJj.js → cypher-editor-ef6RdDgm.js} +1 -1
- package/public/assets/{da-DK-5WZEPLOC-nBVf9B0e.js → da-DK-5WZEPLOC-C-5tRCvs.js} +1 -1
- package/public/assets/{daily-notes-settings-DG9RUcYk.js → daily-notes-settings-CCotd1Iq.js} +1 -1
- package/public/assets/{dashboard-grid-BvlcalWZ.js → dashboard-grid-DKMK4z_a.js} +1 -1
- package/public/assets/dashboard-workspace-4u-QaXby.js +4 -0
- package/public/assets/{dashboards-settings-module-CMkRnuLc.js → dashboards-settings-module-DmE0Krje.js} +1 -1
- package/public/assets/{dashboards-view-BB1CRB2G.js → dashboards-view-DxUAl6zg.js} +1 -1
- package/public/assets/{de-DE-XR44H4JA-wIoI5uHM.js → de-DE-XR44H4JA-4wneKMQi.js} +1 -1
- package/public/assets/{desktop-server-settings-j8RrUDQh.js → desktop-server-settings-DDd8PcxW.js} +1 -1
- package/public/assets/{directory-picker-columns-BDdL8yxc.js → directory-picker-columns-CqPZNMT8.js} +1 -1
- package/public/assets/{discovery-create-popup-DpDB1MTg.js → discovery-create-popup-BSOSYM4o.js} +1 -1
- package/public/assets/{discovery-import-popup-BsyONSTT.js → discovery-import-popup-NodFxSW1.js} +1 -1
- package/public/assets/{discovery-settings-module-CSz3wdqd.js → discovery-settings-module-DQMZismj.js} +1 -1
- package/public/assets/{discovery-view-DOb6HJff.js → discovery-view-PiwStXSa.js} +1 -1
- package/public/assets/discovery-workspace-BTrjBF19.js +2 -0
- package/public/assets/{dist-tLZONR8L.js → dist-B58c6eJE.js} +1 -1
- package/public/assets/drag-preview-D61OK7zr.js +1 -0
- package/public/assets/{drawing-note-BZkhWRBb.js → drawing-note-BytzAih9.js} +1 -1
- package/public/assets/{el-GR-BZB4AONW-BoxDB0UD.js → el-GR-BZB4AONW-BUDxOK9m.js} +1 -1
- package/public/assets/{en-B4ZKOASM-D3_h4H29.js → en-B4ZKOASM-jB7I34Md.js} +1 -1
- package/public/assets/{es-ES-U4NZUMDT-BTF8-J9f.js → es-ES-U4NZUMDT-gXLOOlpz.js} +1 -1
- package/public/assets/{esm-zhVSGSwY.js → esm-BSlSeh8A.js} +1 -1
- package/public/assets/{eu-ES-A7QVB2H4-PqSQa04Y.js → eu-ES-A7QVB2H4-4kiV_opo.js} +1 -1
- package/public/assets/{fa-IR-HGAKTJCU-B03HX6BC.js → fa-IR-HGAKTJCU-C7F0Dl4h.js} +1 -1
- package/public/assets/{feature-switch-section-CDTUV6B-.js → feature-switch-section-617S6UWP.js} +1 -1
- package/public/assets/{fi-FI-Z5N7JZ37-D5Rn9AGc.js → fi-FI-Z5N7JZ37-DEUSwc4a.js} +1 -1
- package/public/assets/{file-editor-DTm2a8_D.js → file-editor-DvP7rRI9.js} +3 -3
- package/public/assets/{file-language-C8bPT8Wh.js → file-language-DjeubQk3.js} +1 -1
- package/public/assets/{file-preview-Bp9k2YvK.js → file-preview-AkYowAab.js} +1 -1
- package/public/assets/{file-preview-media-CNZHdx05.js → file-preview-media-DL2hGeeZ.js} +1 -1
- package/public/assets/{file-references-api-CSyFnFFm.js → file-references-api-C2G0bSy9.js} +1 -1
- package/public/assets/{files-settings-module-D4HPlkbW.js → files-settings-module-DsylYhrR.js} +1 -1
- package/public/assets/files-view-B6_Mlm9V.css +1 -0
- package/public/assets/files-view-DPSrj_WW.js +3 -0
- package/public/assets/{folder-picker-dialog-D57Q15N4.js → folder-picker-dialog-D_VCqm_i.js} +1 -1
- package/public/assets/{format-panel-value-DYwL3ttM.js → format-panel-value-vueBm4DQ.js} +1 -1
- package/public/assets/{fr-FR-RHASNOE6-BoIuGpVa.js → fr-FR-RHASNOE6-BKLo10bn.js} +1 -1
- package/public/assets/{gl-ES-HMX3MZ6V-R9gfMkm_.js → gl-ES-HMX3MZ6V-D_nHnidC.js} +1 -1
- package/public/assets/{graph-explorer-DtYVExeD.js → graph-explorer-CHz-bFkx.js} +5 -5
- package/public/assets/{graph-settings-module-D--vzqKr.js → graph-settings-module-9hY9bkdT.js} +1 -1
- package/public/assets/{he-IL-6SHJWFNN-DLh6r8yJ.js → he-IL-6SHJWFNN-BXKK7JWx.js} +1 -1
- package/public/assets/{hi-IN-IWLTKZ5I-DsP1yUVR.js → hi-IN-IWLTKZ5I-D2utCBQM.js} +1 -1
- package/public/assets/{hu-HU-A5ZG7DT2-ttWV7_mJ.js → hu-HU-A5ZG7DT2-BENIngFF.js} +1 -1
- package/public/assets/{id-ID-SAP4L64H-DIFD1Rmb.js → id-ID-SAP4L64H-Bw77jJOj.js} +1 -1
- package/public/assets/{ide-settings-module-Dsg4tJV6.js → ide-settings-module-BbIX3okW.js} +1 -1
- package/public/assets/ide-view-0vK2duKI.js +2 -0
- package/public/assets/{image-GAAHSSAO-C38PUNrv.js → image-GAAHSSAO-D4NDL8F6.js} +1 -1
- package/public/assets/{imap-accounts-QVDGlYad.js → imap-accounts-BRbnITJv.js} +1 -1
- package/public/assets/index-BVDhmwI8.js +11 -0
- package/public/assets/index-DjUUY3gd.css +1 -0
- package/public/assets/{it-IT-JPQ66NNP-D9CIdJgS.js → it-IT-JPQ66NNP-DiG4G8vQ.js} +1 -1
- package/public/assets/{ja-JP-DBVTYXUO-CYn7dH3E.js → ja-JP-DBVTYXUO-CILN9NGs.js} +1 -1
- package/public/assets/{journal-create-popup-DnYgWgDU.js → journal-create-popup-39y9ieVG.js} +1 -1
- package/public/assets/{journal-day-route-DpsYGWU7.js → journal-day-route-CYlyL-u0.js} +1 -1
- package/public/assets/{journal-folder-field-DuvIgT6Y.js → journal-folder-field-BfO-_ied.js} +1 -1
- package/public/assets/{journal-page-BdQlNdyB.js → journal-page-TgyVFaPE.js} +2 -2
- package/public/assets/{journal-settings-Dq-9Conv.js → journal-settings-CfjXOXzF.js} +1 -1
- package/public/assets/{journal-typography-QR4z5v0X.js → journal-typography-D3O3AK2U.js} +1 -1
- package/public/assets/journal-writing-route-CYhXzipC.js +1 -0
- package/public/assets/journals-view-DNomC0nF.js +1 -0
- package/public/assets/{kaa-6HZHGXH3-DmZqyxcr.js → kaa-6HZHGXH3-BUua-YiR.js} +1 -1
- package/public/assets/{kab-KAB-ZGHBKWFO-BnEoO3f6.js → kab-KAB-ZGHBKWFO-yPJB-J7N.js} +1 -1
- package/public/assets/{kk-KZ-P5N5QNE5-DcYcuRxx.js → kk-KZ-P5N5QNE5-CAitSjw5.js} +1 -1
- package/public/assets/{km-KH-HSX4SM5Z-DO6DHT6h.js → km-KH-HSX4SM5Z-CSZjabru.js} +1 -1
- package/public/assets/{ko-KR-MTYHY66A-Ch6OwlXE.js → ko-KR-MTYHY66A-CGEXYXZz.js} +1 -1
- package/public/assets/{ku-TR-6OUDTVRD-C9KHFYbx.js → ku-TR-6OUDTVRD-DOfuZRKI.js} +1 -1
- package/public/assets/{link-file-browser-BvVwFMvC.js → link-file-browser-A_Mappx0.js} +1 -1
- package/public/assets/{link-kind-icon-r9mUfWOh.js → link-kind-icon-BMfHfR_C.js} +1 -1
- package/public/assets/{link-picker-C90irWTA.js → link-picker-BfwWXJZg.js} +2 -2
- package/public/assets/{locked-shares-prompt-CA0MuZ_G.js → locked-shares-prompt-BsM-ai_V.js} +1 -1
- package/public/assets/{logging-settings-contribution-C55dtngt.js → logging-settings-contribution-BLHCBnwO.js} +1 -1
- package/public/assets/logic-DtHJ5GlU.js +28 -0
- package/public/assets/{lt-LT-XHIRWOB4-CrK3hZ26.js → lt-LT-XHIRWOB4-CmbJTJAh.js} +1 -1
- package/public/assets/{lv-LV-5QDEKY6T-BOA9oRt-.js → lv-LV-5QDEKY6T-Br-VqxTs.js} +1 -1
- package/public/assets/{markdown-message-9f2rcF0-.js → markdown-message-BIo2pHhE.js} +2 -2
- package/public/assets/{markdown-task-toggle-DiIwYCgC.js → markdown-task-toggle-9k1EldDD.js} +3 -3
- package/public/assets/{matrices-settings-module-DPI1_WsY.js → matrices-settings-module-DKGdrCad.js} +1 -1
- package/public/assets/{matrices-view-CQlirOdv.js → matrices-view-DYF7e5ES.js} +1 -1
- package/public/assets/matrix-workspace-JZhH-HQ5.js +1 -0
- package/public/assets/{maximize-2-C6N1RKlt.js → maximize-2-DATMN9kx.js} +1 -1
- package/public/assets/{mermaid-diagram-CnzQOrTI.js → mermaid-diagram-gUL2-JyE.js} +1 -1
- package/public/assets/{mobile-file-text-B4j-_eP4.js → mobile-file-text-meniSeto.js} +1 -1
- package/public/assets/{mobile-note-content-editor-znLhIM9A.js → mobile-note-content-editor-C6TUyA4F.js} +2 -2
- package/public/assets/{mobile-panel-layer-C2OowtdM.js → mobile-panel-layer-2EcEm-JB.js} +1 -1
- package/public/assets/model-provider-settings-contribution-CfHiu3nS.js +1 -0
- package/public/assets/model-providers-cQOCMmwX.js +1 -0
- package/public/assets/{mr-IN-CRQNXWMA-GWTqYMNI.js → mr-IN-CRQNXWMA-DwF8SFQB.js} +1 -1
- package/public/assets/{my-MM-5M5IBNSE-DnqvLQeM.js → my-MM-5M5IBNSE-BEiMo9eJ.js} +1 -1
- package/public/assets/{nb-NO-T6EIAALU-DyrWt8fZ.js → nb-NO-T6EIAALU-BelWzTQs.js} +1 -1
- package/public/assets/{nl-NL-IS3SIHDZ-COWPkkr8.js → nl-NL-IS3SIHDZ-Ce06PPL4.js} +1 -1
- package/public/assets/{nn-NO-6E72VCQL-8aH2uP9Y.js → nn-NO-6E72VCQL-BbXlzJzR.js} +1 -1
- package/public/assets/note-collab-provider-B9DpnE58.js +1 -0
- package/public/assets/note-collab-transport-BHZ891IL.js +1 -0
- package/public/assets/{note-create-settings-module-CV4dWr8t.js → note-create-settings-module-rIZc1DjQ.js} +1 -1
- package/public/assets/{note-documents-DCd2HaSQ.js → note-documents-CcJDTkta.js} +2 -2
- package/public/assets/note-editor-container-DL3yLdYs.js +2 -0
- package/public/assets/{note-editor-settings-module-CbPu_40k.js → note-editor-settings-module-DI0jRyPy.js} +1 -1
- package/public/assets/{note-excalidraw-editor-RjnG4My9.js → note-excalidraw-editor-fDQ1JVBh.js} +11 -11
- package/public/assets/{note-export-api-2u0sbOpc.js → note-export-api-CwuXGV0y.js} +1 -1
- package/public/assets/{note-export-flow-B3wRdMj0.js → note-export-flow-DcBoI5Pp.js} +1 -1
- package/public/assets/{note-filter-rule-rows-BajgD2k3.js → note-filter-rule-rows-DFSWBwql.js} +1 -1
- package/public/assets/{note-folds-settings-module-DZju6Mum.js → note-folds-settings-module-CFfVg1Cp.js} +1 -1
- package/public/assets/{note-frontmatter-summary-BSKg__aS.js → note-frontmatter-summary-iubFPHA_.js} +1 -1
- package/public/assets/{note-link-list-DKU2PqtO.js → note-link-list-CI9-GM_3.js} +1 -1
- package/public/assets/{note-markdown-editor-CXelEHqr.js → note-markdown-editor-lG6gZT9i.js} +10 -10
- package/public/assets/{note-outline-CNoqBtUP.js → note-outline-BFidIp-8.js} +1 -1
- package/public/assets/note-page-content-8gzPBWMV.js +2 -0
- package/public/assets/{note-page-editor-rhBoxKYB.js → note-page-editor-DpVUxkCx.js} +4 -4
- package/public/assets/{note-path-breadcrumb-uTSXCQK4.js → note-path-breadcrumb-HmtWyYZP.js} +1 -1
- package/public/assets/{note-picker-BD8rmAOq.js → note-picker-B5i41l1u.js} +1 -1
- package/public/assets/{note-picker-popover-DI9Wc706.js → note-picker-popover-B9VTeHiM.js} +1 -1
- package/public/assets/{note-shares-popup-9sJOmL1-.js → note-shares-popup-aUO1SNLN.js} +1 -1
- package/public/assets/{note-source-editor-DWyDYMCj.js → note-source-editor-BXPR_-41.js} +1 -1
- package/public/assets/{note-type-grid-BFX3oTAC.js → note-type-grid-CRCfpYZy.js} +2 -2
- package/public/assets/{note-values-BqD4746M.js → note-values-6D6wWXPg.js} +1 -1
- package/public/assets/{notes-settings-module-C5IPmwKt.js → notes-settings-module-DcP9Hid-.js} +1 -1
- package/public/assets/{oc-FR-POXYY2M6-C_R_VP74.js → oc-FR-POXYY2M6-CyRgkETq.js} +1 -1
- package/public/assets/{open-journal-writing-Bd-CppeX.js → open-journal-writing-Bub8Zn13.js} +1 -1
- package/public/assets/{pa-IN-N4M65BXN-B21EEaul.js → pa-IN-N4M65BXN-A1_Q9748.js} +1 -1
- package/public/assets/page-content-B3fNjwr-.js +1 -0
- package/public/assets/{page-files-BMj9IzfB.js → page-files-CSqFupDZ.js} +1 -1
- package/public/assets/page-note-nmiinGCs.js +1 -0
- package/public/assets/{pane-keys-CTLoUZZR.js → pane-keys-osajBGnu.js} +1 -1
- package/public/assets/{panel-columns-fields-DPjV39xn.js → panel-columns-fields-ZlW6A4My.js} +1 -1
- package/public/assets/{pdf-view-Cm78nuSA.js → pdf-view-BATpBLO5.js} +1 -1
- package/public/assets/{pencil-DQ9fAqT6.js → pencil-xxFNyZzr.js} +1 -1
- package/public/assets/{percentages-BXMCSKIN-CUt8fyAS.js → percentages-BXMCSKIN-DzsiA6IB.js} +1 -1
- package/public/assets/{phone-numbers-CHQaYRah.js → phone-numbers-BQgyhfcH.js} +1 -1
- package/public/assets/{pl-PL-T2D74RX3-Bdo_j9QK.js → pl-PL-T2D74RX3-DaINIVjz.js} +1 -1
- package/public/assets/provider-configuration-CSnNV6ps.css +1 -0
- package/public/assets/provider-configuration-DaFovElx.js +8 -0
- package/public/assets/provider-use-select-D-lJiZ2W.js +1 -0
- package/public/assets/{pt-BR-5N22H2LF-C9DRQ7CW.js → pt-BR-5N22H2LF-ENVHjTz_.js} +1 -1
- package/public/assets/{pt-PT-UZXXM6DQ-ColydZPV.js → pt-PT-UZXXM6DQ-D5Uqv0Vz.js} +1 -1
- package/public/assets/{qr-code-Bm7I0KYt.js → qr-code-CDBCi1Cu.js} +2 -2
- package/public/assets/{qr-code-svg-D0RAuUIk.js → qr-code-svg-8ENstC8b.js} +1 -1
- package/public/assets/qr-defaults-settings-C_8ybA4R.js +1 -0
- package/public/assets/qr-settings-fields-C2-DGF6a.js +1 -0
- package/public/assets/qr-viewer-DAOzDI8d.js +1 -0
- package/public/assets/{reader-clock-22DkpiWR.js → reader-clock-7x7Yvzv1.js} +1 -1
- package/public/assets/{recording-bar-DOm-SEGc.js → recording-bar-BcuvYwhh.js} +2 -2
- package/public/assets/{recording-setup-CV3LE2_1.js → recording-setup-D_MgrYb7.js} +1 -1
- package/public/assets/{recordings-api-C-Bxpzgo.js → recordings-api-Ds77lFsk.js} +1 -1
- package/public/assets/resource-overview-card-BainFWKz.js +1 -0
- package/public/assets/{ro-RO-JPDTUUEW-iJAQDPe9.js → ro-RO-JPDTUUEW-Dq_ouOp1.js} +1 -1
- package/public/assets/{rss-preferences-Bx1Wa4ri.js → rss-preferences-BafuZ3Ku.js} +1 -1
- package/public/assets/{rss-settings-module-BmDISWDk.js → rss-settings-module-Df-YS9tr.js} +1 -1
- package/public/assets/rss-view-BORHnuIQ.js +3 -0
- package/public/assets/rss-view-DIPQBTLT.css +1 -0
- package/public/assets/{ru-RU-B4JR7IUQ-CX_CWbT7.js → ru-RU-B4JR7IUQ-CqqISqJC.js} +1 -1
- package/public/assets/{safe-block-copy-DygjvDD4.js → safe-block-copy-BOVhmncw.js} +1 -1
- package/public/assets/{safe-block-qr-button-Cn9WpEkl.js → safe-block-qr-button-CD7cJG3N.js} +1 -1
- package/public/assets/{safe-block-reader-CNfzTExh.js → safe-block-reader-BkilW4Hj.js} +1 -1
- package/public/assets/safe-folder-conversion-DWTRwvTH.js +1 -0
- package/public/assets/{safe-folders-DCf8IdrM.js → safe-folders-DmvM6dtV.js} +1 -1
- package/public/assets/{safe-move-leaving-tN-IMhDo.js → safe-move-leaving-BT5e1h3p.js} +1 -1
- package/public/assets/{safe-note-locked-B_lt0XcX.js → safe-note-locked-BDCeVwpK.js} +1 -1
- package/public/assets/{safe-notes-settings-module-CMvkyfNG.js → safe-notes-settings-module-BrZreYgf.js} +1 -1
- package/public/assets/search-settings-module-CPnculiI.js +1 -0
- package/public/assets/{secret-form-DSD348Om.js → secret-form-B-YAlbZf.js} +1 -1
- package/public/assets/{secret-popup-y9W7WIrZ.js → secret-popup-CoVpeLZV.js} +1 -1
- package/public/assets/{security-settings-contribution-B_Syg5ab.js → security-settings-contribution-BmcZq1hf.js} +1 -1
- package/public/assets/settings-CU8YR8di.js +1 -0
- package/public/assets/{settings-edit-dialog-B5emNjJi.js → settings-edit-dialog-C_AeTz9Y.js} +1 -1
- package/public/assets/settings-panel-Ds7lOtnD.js +1 -0
- package/public/assets/settings-view-BTz2XbnW.js +4 -0
- package/public/assets/{settings-view-6_hMxTXD.css → settings-view-Bd65kLGK.css} +1 -1
- package/public/assets/{setup-prompt-6JRbE0oa.js → setup-prompt-BbpHVdla.js} +1 -1
- package/public/assets/{share-access-control-C5mpELVT.js → share-access-control-CzAVEv6b.js} +1 -1
- package/public/assets/share-label-CbjQ9iMF.js +1 -0
- package/public/assets/{shared-board-lanes-UWl9klys.js → shared-board-lanes-CAbJAFk6.js} +1 -1
- package/public/assets/{shared-calendar-view-DcCO3mNo.js → shared-calendar-view-DTzDjSs0.js} +1 -1
- package/public/assets/shared-note-route-B_gfX0Nl.js +4 -0
- package/public/assets/{shared-note-text-BdCw7a9a.js → shared-note-text-DFBEyL8Z.js} +1 -1
- package/public/assets/{shares-settings-module-9oF4v70A.js → shares-settings-module-pIdBLmCq.js} +1 -1
- package/public/assets/{si-LK-N5RQ5JYF-DfLSaLm6.js → si-LK-N5RQ5JYF-DmhE8IT5.js} +1 -1
- package/public/assets/{sk-SK-C5VTKIMK-DrAaUVFC.js → sk-SK-C5VTKIMK-YiOZ-xKA.js} +1 -1
- package/public/assets/{sl-SI-NN7IZMDC-WxYLW2Uj.js → sl-SI-NN7IZMDC-BKb37Hlu.js} +1 -1
- package/public/assets/{spaces-settings-module-Dh_QfANj.js → spaces-settings-module-BLU1RsTS.js} +1 -1
- package/public/assets/spaces-view-BhWD3mAw.js +2 -0
- package/public/assets/{sqlite-browser-BfIrq_0x.js → sqlite-browser-C98PFoRG.js} +2 -2
- package/public/assets/{store-attachments-DNyH0asy.js → store-attachments-DbqF7LgE.js} +1 -1
- package/public/assets/{stored-color-picker-CYL7LYdQ.js → stored-color-picker-DLX-e5Nq.js} +1 -1
- package/public/assets/subset-shared.chunk-D8M638AI.js +1 -0
- package/public/assets/{subset-worker.chunk-BrbK91mW.js → subset-worker.chunk-B9ZhBm-P.js} +1 -1
- package/public/assets/{sv-SE-XGPEYMSR-DOB2jm3x.js → sv-SE-XGPEYMSR-VT0snW-T.js} +1 -1
- package/public/assets/{ta-IN-2NMHFXQM-DfC3wGVU.js → ta-IN-2NMHFXQM--MqIf2Jf.js} +1 -1
- package/public/assets/{text-diff-BzNG8nfy.js → text-diff-BmKfp7mY.js} +1 -1
- package/public/assets/{th-TH-HPSO5L25-BsqplWuv.js → th-TH-HPSO5L25-CTKAmQrO.js} +1 -1
- package/public/assets/{theme-colors-2LJ6VIeK.js → theme-colors-zbTaiYL0.js} +1 -1
- package/public/assets/{toolbar-items-DF7H0MSb.js → toolbar-items-DLi0bl0c.js} +1 -1
- package/public/assets/{topology-code-editor-B7zxDyT3.js → topology-code-editor-CNnSyUQ3.js} +1 -1
- package/public/assets/topology-designer-T54LYLYv.js +1 -0
- package/public/assets/topology-editor-aGtCktzA.js +8 -0
- package/public/assets/{topology-folder-migration-popup-Bj4nu8HE.js → topology-folder-migration-popup-C0Wc3ViK.js} +1 -1
- package/public/assets/{topology-settings-module-cWWujj9j.js → topology-settings-module-Dp-Sm37Z.js} +1 -1
- package/public/assets/{tr-TR-DEFEU3FU-DWO1lNTH.js → tr-TR-DEFEU3FU-BVLSiyVW.js} +1 -1
- package/public/assets/{transcription-settings-HrJHl14H.js → transcription-settings-BldPwHO7.js} +4 -4
- package/public/assets/{uk-UA-QMV73CPH-ZHBKj9kv.js → uk-UA-QMV73CPH-DQ4YsZml.js} +1 -1
- package/public/assets/{unlock-prompt-C1AEyIR_.js → unlock-prompt-CkkcVo9g.js} +1 -1
- package/public/assets/{use-candidate-notes-Du1V_uun.js → use-candidate-notes-jH4-EW29.js} +1 -1
- package/public/assets/{use-directory-listing-BaYgcuHI.js → use-directory-listing-Cn9t21ra.js} +1 -1
- package/public/assets/{use-folding-enabled-CyYip5Go.js → use-folding-enabled-DKvri2UA.js} +1 -1
- package/public/assets/{use-live-document-Ck_XPFVd.js → use-live-document-D4PkZrbU.js} +1 -1
- package/public/assets/{use-mobile-layer-navigation-CBRepW9w.js → use-mobile-layer-navigation-BIC7HlT_.js} +1 -1
- package/public/assets/{use-note-attachments-SPgAe-M0.js → use-note-attachments-Bew073Hl.js} +1 -1
- package/public/assets/{use-note-delete-Dvrzq6Pl.js → use-note-delete-fFNH1Glk.js} +1 -1
- package/public/assets/use-note-editor-session-R1wm0xDf.js +1 -0
- package/public/assets/{use-note-export-flow-0uAfXAwf.js → use-note-export-flow-Dm7yhW5s.js} +2 -2
- package/public/assets/use-provider-dialogs-CrxN9JCo.js +1 -0
- package/public/assets/{use-reflection-request-DV5-_c14.js → use-reflection-request-C1DxtaYX.js} +3 -3
- package/public/assets/{use-safe-folder-moves-0nw2jjTX.js → use-safe-folder-moves-DjQUnMvz.js} +1 -1
- package/public/assets/{use-safe-folders-apply-C9pni8YW.js → use-safe-folders-apply-B1V8l7WU.js} +1 -1
- package/public/assets/{use-screen-source-BllYITR6.js → use-screen-source-CF-48NnC.js} +1 -1
- package/public/assets/use-share-actions-kb7uFat_.js +1 -0
- package/public/assets/{use-vault-file-link-C0ZO_VPm.js → use-vault-file-link-B-ZRcKDu.js} +1 -1
- package/public/assets/{use-voice-questions-Bjgb45Dc.js → use-voice-questions-DGVQlAST.js} +1 -1
- package/public/assets/{vault-entries-api-DVVjgeZh.js → vault-entries-api-pFsJiGnJ.js} +1 -1
- package/public/assets/vault-manager-YKz_Ib18.js +1 -0
- package/public/assets/{vault-settings-module-DMjLQmKz.js → vault-settings-module-CCMMSy4B.js} +1 -1
- package/public/assets/{vault-shares-popup-CCPGkRmF.js → vault-shares-popup-CaGnEIJA.js} +1 -1
- package/public/assets/{versioning-preferences-dvxhrMo9.js → versioning-preferences-DrNq-y_0.js} +1 -1
- package/public/assets/{versioning-settings-module-CnDDngKG.js → versioning-settings-module-Ddug486c.js} +1 -1
- package/public/assets/versioning-view-PR4R4gks.js +2 -0
- package/public/assets/{vi-VN-M7AON7JQ-uUfHJEho.js → vi-VN-M7AON7JQ-B-fHV7o8.js} +1 -1
- package/public/assets/video-recording-dialog-CxRs1eLE.js +1 -0
- package/public/assets/{video-recording-settings-D6YT_FW3.js → video-recording-settings-B2iE6IdW.js} +1 -1
- package/public/assets/{widget-frame-CjlAZSUy.js → widget-frame-DiF4946k.js} +1 -1
- package/public/assets/{zh-CN-LNUGB5OW-COz3oRg3.js → zh-CN-LNUGB5OW-CUgxiiUV.js} +1 -1
- package/public/assets/{zh-HK-E62DVLB3-C8ICkLhf.js → zh-HK-E62DVLB3-D-87W8QH.js} +1 -1
- package/public/assets/{zh-TW-RAJ6MFWO-AYdVqmV8.js → zh-TW-RAJ6MFWO-BVaf47B6.js} +1 -1
- package/public/index.html +3 -3
- package/public/assets/board-workspace-DPSlmJ8w.js +0 -1
- package/public/assets/calendar-workspace-6t1kuFgj.js +0 -1
- package/public/assets/chat-message-list-ClUR56GV.js +0 -1
- package/public/assets/color-picker-ClAn42eA.js +0 -1
- package/public/assets/create-note-popup-CRi210cC.js +0 -1
- package/public/assets/dashboard-workspace-D45MA_Wf.js +0 -4
- package/public/assets/discovery-workspace-Cyc70gQ1.js +0 -2
- package/public/assets/drag-preview-Cb6aidku.js +0 -1
- package/public/assets/files-view-BIDZtZgg.js +0 -3
- package/public/assets/files-view-Bo1uBB_W.css +0 -1
- package/public/assets/ide-view-DCvwb5Bx.js +0 -2
- package/public/assets/index-B8xguO4f.css +0 -1
- package/public/assets/index-CCUyKE6q.js +0 -11
- package/public/assets/journal-writing-route-JP-jPBGZ.js +0 -1
- package/public/assets/journals-view-No5xQN8-.js +0 -1
- package/public/assets/logic-BNk_20eJ.js +0 -28
- package/public/assets/matrix-workspace-C3LhTNPX.js +0 -1
- package/public/assets/model-provider-settings-contribution-DYmNbsgA.js +0 -1
- package/public/assets/model-providers-7VKk3K9H.js +0 -8
- package/public/assets/model-providers-DgRkVmP5.css +0 -1
- package/public/assets/note-collab-provider-969Kgyu8.js +0 -1
- package/public/assets/note-collab-transport-CQDYt_Db.js +0 -1
- package/public/assets/note-editor-container-CTnEE-98.js +0 -2
- package/public/assets/note-page-content-DIqkiMvt.js +0 -2
- package/public/assets/page-content-C1jtzs7H.js +0 -1
- package/public/assets/page-note-Chw2UF0u.js +0 -1
- package/public/assets/provider-use-select-DCSwSrlz.js +0 -1
- package/public/assets/qr-defaults-settings-2_Yt9x4N.js +0 -1
- package/public/assets/qr-settings-fields-DDO4XgMl.js +0 -1
- package/public/assets/qr-viewer-CvEfRC2r.js +0 -1
- package/public/assets/resource-overview-card-Co8aU6jw.js +0 -1
- package/public/assets/rss-view-5aqCVOCs.css +0 -1
- package/public/assets/rss-view-BCEFsYtS.js +0 -1
- package/public/assets/safe-folder-conversion-BOLpnv8P.js +0 -1
- package/public/assets/search-settings-module-DmczYjcQ.js +0 -1
- package/public/assets/settings-ChT117Ke.js +0 -1
- package/public/assets/settings-panel-Cl5kUs9O.js +0 -1
- package/public/assets/settings-view-C_lfjngd.js +0 -3
- package/public/assets/share-label-BU3So3s7.js +0 -1
- package/public/assets/shared-note-route-DaI6hm83.js +0 -4
- package/public/assets/spaces-view-Dw2uxDxU.js +0 -2
- package/public/assets/subset-shared.chunk-D1nlqSEH.js +0 -1
- package/public/assets/topology-designer-CvJN6QTV.js +0 -1
- package/public/assets/topology-editor-RZ0_yLuO.js +0 -8
- package/public/assets/use-note-editor-session-CRC-natg.js +0 -1
- package/public/assets/use-share-actions-ujEMhCfl.js +0 -1
- package/public/assets/vault-manager-CMQaGDss.js +0 -1
- package/public/assets/versioning-view-BsIFugt4.js +0 -2
- package/public/assets/video-recording-dialog-7IGrQMwx.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{d as t,m as n,t as r}from"./react-B3NTyEzE.js";import{$n as i,$t as a,Bt as o,Cn as s,Cr as c,Dt as l,Et as u,Gn as d,Gt as f,Hn as p,In as m,Jn as h,Kn as g,Sn as _,Sr as v,T as y,Tn as b,Wn as x,Wt as S,Y as C,Zn as w,_r as T,ar as E,fr as D,gr as O,hr as k,in as A,ir as j,ln as ee,lr as M,mn as N,mr as P,nr as te,or as F,pn as ne,rr as re,sr as I,vr as L,wn as R,zt as ie}from"./index-BVDhmwI8.js";import{B as z,Bs as B,Dl as V,El as H,Hs as ae,Tl as oe,Us as se,Ws as ce,ad as U,hd as le,od as W,pd as ue,rd as G,zr as K}from"./logic-DtHJ5GlU.js";import{t as de}from"./use-available-workspace-width-CS1Bz0sU.js";import{t as fe}from"./ListBullets.es-DGeupXZ3.js";import{E as pe,F as q,I as me,N as he,P as ge,b as _e,c as ve,h as ye,n as be,y as xe,z as J}from"./icons-CxH3_W-q.js";import{t as Se}from"./Play.es-h1Fhb5wo.js";import{t as Y}from"./ArrowSquareOut.es-ssfQ7LE-.js";import{t as Ce}from"./Eye.es-DKoV8w-8.js";import{t as we}from"./EyeSlash.es-C_H7lJGL.js";import{t as Te}from"./TextAa.es-CymAJ91v.js";import{a as Ee,c as De,d as Oe,f as ke,i as Ae,l as je,m as Me,n as Ne,o as Pe,p as Fe,r as Ie,s as Le,t as Re,u as ze}from"./rss-preferences-BafuZ3Ku.js";import{t as Be}from"./markdown-message-BIo2pHhE.js";import{d as Ve}from"./state-9kAy-W2i.js";import{t as He}from"./Microphone.es-CQat-MJ8.js";import{n as Ue}from"./imap-accounts-BRbnITJv.js";import{t as X}from"./Plus.es-B-svcAlu.js";import{t as We}from"./useInfiniteQuery-BgmUybTP.js";import{t as Ge}from"./ArrowsClockwise.es-DSXy5pW3.js";import{t as Ke}from"./Trash.es-B7UVM9v_.js";import{t as qe}from"./SlidersHorizontal.es-DkPz8o7o.js";import{Vt as Je}from"./codemirror-BqrpJAnL.js";import{t as Ye}from"./code-editor-CxLqzVwa.js";var Z=e(n(),1),Xe=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M243,96a20.33,20.33,0,0,0-17.74-14l-56.59-4.57L146.83,24.62a20.36,20.36,0,0,0-37.66,0L87.35,77.44,30.76,82A20.45,20.45,0,0,0,19.1,117.88l43.18,37.24-13.2,55.7A20.37,20.37,0,0,0,79.57,233L128,203.19,176.43,233a20.39,20.39,0,0,0,30.49-22.15l-13.2-55.7,43.18-37.24A20.43,20.43,0,0,0,243,96ZM172.53,141.7a12,12,0,0,0-3.84,11.86L181.58,208l-47.29-29.08a12,12,0,0,0-12.58,0L74.42,208l12.89-54.4a12,12,0,0,0-3.84-11.86L41.2,105.24l55.4-4.47a12,12,0,0,0,10.13-7.38L128,41.89l21.27,51.5a12,12,0,0,0,10.13,7.38l55.4,4.47Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M229.06,108.79l-48.7,42,14.88,62.79a8.4,8.4,0,0,1-12.52,9.17L128,189.09,73.28,222.74a8.4,8.4,0,0,1-12.52-9.17l14.88-62.79-48.7-42A8.46,8.46,0,0,1,31.73,94L95.64,88.8l24.62-59.6a8.36,8.36,0,0,1,15.48,0l24.62,59.6L224.27,94A8.46,8.46,0,0,1,229.06,108.79Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237.28,97.87A14.18,14.18,0,0,0,224.76,88l-60.25-4.87-23.22-56.2a14.37,14.37,0,0,0-26.58,0L91.49,83.11,31.24,88a14.18,14.18,0,0,0-12.52,9.89A14.43,14.43,0,0,0,23,113.32L69,152.93l-14,59.25a14.4,14.4,0,0,0,5.59,15,14.1,14.1,0,0,0,15.91.6L128,196.12l51.58,31.71a14.1,14.1,0,0,0,15.91-.6,14.4,14.4,0,0,0,5.59-15l-14-59.25L233,113.32A14.43,14.43,0,0,0,237.28,97.87Zm-12.14,6.37-48.69,42a6,6,0,0,0-1.92,5.92l14.88,62.79a2.35,2.35,0,0,1-.95,2.57,2.24,2.24,0,0,1-2.6.1L131.14,184a6,6,0,0,0-6.28,0L70.14,217.61a2.24,2.24,0,0,1-2.6-.1,2.35,2.35,0,0,1-1-2.57l14.88-62.79a6,6,0,0,0-1.92-5.92l-48.69-42a2.37,2.37,0,0,1-.73-2.65,2.28,2.28,0,0,1,2.07-1.65l63.92-5.16a6,6,0,0,0,5.06-3.69l24.63-59.6a2.35,2.35,0,0,1,4.38,0l24.63,59.6a6,6,0,0,0,5.06,3.69l63.92,5.16a2.28,2.28,0,0,1,2.07,1.65A2.37,2.37,0,0,1,225.14,104.24Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M235.36,98.49A12.21,12.21,0,0,0,224.59,90l-61.47-5L139.44,27.67a12.37,12.37,0,0,0-22.88,0L92.88,85,31.41,90a12.45,12.45,0,0,0-7.07,21.84l46.85,40.41L56.87,212.64a12.35,12.35,0,0,0,18.51,13.49L128,193.77l52.62,32.36a12.12,12.12,0,0,0,13.69-.51,12.28,12.28,0,0,0,4.82-13l-14.32-60.42,46.85-40.41A12.29,12.29,0,0,0,235.36,98.49Zm-8.93,7.26-48.68,42a4,4,0,0,0-1.28,3.95l14.87,62.79a4.37,4.37,0,0,1-1.72,4.65,4.24,4.24,0,0,1-4.81.18L130.1,185.67a4,4,0,0,0-4.2,0L71.19,219.32a4.24,4.24,0,0,1-4.81-.18,4.37,4.37,0,0,1-1.72-4.65L79.53,151.7a4,4,0,0,0-1.28-3.95l-48.68-42A4.37,4.37,0,0,1,28.25,101a4.31,4.31,0,0,1,3.81-3L96,92.79a4,4,0,0,0,3.38-2.46L124,30.73a4.35,4.35,0,0,1,8.08,0l24.62,59.6A4,4,0,0,0,160,92.79l63.9,5.15a4.31,4.31,0,0,1,3.81,3A4.37,4.37,0,0,1,226.43,105.75Z`}))]]),Ze=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:Xe}));Ze.displayName=`StarIcon`;var Qe=[{minutes:15,label:`Every 15 minutes`},{minutes:30,label:`Every 30 minutes`},{minutes:60,label:`Every hour`},{minutes:360,label:`Every 6 hours`},{minutes:1440,label:`Once a day`},{minutes:0,label:`Only when asked`}];function $e(e){return Qe.some(t=>t.minutes===e)?Qe:[...Qe,{minutes:e,label:`Every ${e} minutes`}]}var et={layout:`list`,gridSize:`medium`},tt=[{value:`list`,label:`List`},{value:`grid`,label:`Grid`}],nt=[{value:`small`,label:`Small`},{value:`medium`,label:`Medium`},{value:`large`,label:`Large`}];function rt(e){let t=new Set;return e.split(`,`).map(e=>e.replace(/\s+/g,` `).trim().replace(/^#+/,``).trim().toLowerCase()).filter(e=>!e||t.has(e)?!1:(t.add(e),!0))}function it(e,t){let n=new Set,r=[],i=e=>{let t=e.replace(/\s+/g,` `).trim().replace(/^#+/,``).trim().toLowerCase();t&&!n.has(t)&&(n.add(t),r.push(t))};for(let t of e??[])for(let e of t.tags??[])i(e);for(let e of t??[])for(let t of e.custom?.tags??[])i(t);return r.sort((e,t)=>e.localeCompare(t))}var at=`starred`,ot=`liked`,st=`tag:`;function ct(e){return e===`starred`||e===`liked`}function lt(e){return`${st}${e.toLowerCase()}`}function ut(e,t,n=!0){let r=`${e} ${e===1?`entry`:`entries`}`;return n&&t?`${t} unread · ${r}`:r}function dt(e){return e.inbox!==!1}function ft(e){return(e??[]).map(e=>({id:e.id,name:e.name,included:dt(e)}))}var pt=[{id:`all`,title:`Inbox`,kind:`view`},{id:at,title:`Starred items`,kind:`view`},{id:ot,title:`Liked items`,kind:`view`}];function mt(e,t){if(!e.length&&!t?.tags.length)return{sources:[],views:[],tags:[],feeds:[],counts:{},unread:{}};let n=pt,r=e.map(e=>({id:e.id,title:e.name,kind:`feed`,...e.type===`imap`?{feedType:`imap`}:{}})),i=(t?t.tags.map(e=>e.tag):it(e)).map(e=>({id:lt(e),title:e,kind:`tag`,tag:e})),a={},o={},s=(e,t,n=0)=>{a[e]=t?.total??n,t&&(o[e]=t.unread)};for(let n of e)s(n.id,t?.feeds[n.id],n.status.entryCount);s(`all`,t?.inbox,e.filter(dt).reduce((e,t)=>e+t.status.entryCount,0)),s(at,t?.starred),s(ot,t?.liked);for(let e of t?.tags??[])s(lt(e.tag),e);return{sources:[...n,...i,...r],views:n,tags:i,feeds:r,counts:a,unread:o}}function ht(e){return{id:e.id,title:e.title,feedTitle:e.feedName,feedId:e.feedId,...e.author?{author:e.author}:{},...e.published?{published:e.published}:{},...e.summary?{summary:e.summary}:{},...e.content?{content:e.content}:{},...e.link?{link:e.link}:{},...e.cover?{cover:e.cover}:{},...e.categories?{categories:e.categories}:{},...e.custom?{custom:e.custom}:{}}}function gt(e){return e.published?.slice(0,10)}function _t(e){return e?.link?(window.open(e.link,`_blank`,`noopener,noreferrer`),!0):!1}function vt(e){let t=t=>e.filter(e=>e.kind===t).length;return t(`feed`)?`${K(t(`view`),`view`)} · ${K(t(`tag`),`tag`)} · ${K(t(`feed`),`feed`)}`:`No feeds yet`}var yt=/^[A-Za-z0-9_-]{11}$/,bt=/^[A-Za-z0-9]+$/;function xt(e){let t;try{t=new URL(e)}catch{return}if(t.protocol!==`https:`&&t.protocol!==`http:`)return;let n=t.hostname.replace(/^(www|m|music)\./,``),r=t.pathname.split(`/`).filter(Boolean);if(n===`youtube.com`||n===`youtube-nocookie.com`||n===`youtu.be`){let e=n===`youtu.be`?r[0]:r[0]===`watch`?t.searchParams.get(`v`)??void 0:[`shorts`,`embed`,`live`,`v`].includes(r[0])?r[1]:void 0;if(!e||!yt.test(e))return;let i=St(t.searchParams.get(`t`)??t.searchParams.get(`start`));return{provider:`YouTube`,id:e,embedUrl:`https://www.youtube-nocookie.com/embed/${e}?autoplay=1&rel=0${i?`&start=${i}`:``}`,thumbnail:`https://i.ytimg.com/vi/${e}/hqdefault.jpg`}}if(n===`vimeo.com`||n===`player.vimeo.com`){let e=r.findIndex(e=>/^\d+$/.test(e));if(e<0)return;let i=r[e],a=t.searchParams.get(`h`)??(n===`vimeo.com`&&/^[0-9a-f]+$/.test(r[e+1]??``)?r[e+1]:void 0);return{provider:`Vimeo`,id:i,embedUrl:`https://player.vimeo.com/video/${i}?autoplay=1&dnt=1${a?`&h=${a}`:``}`}}if(n===`dailymotion.com`||n===`dai.ly`){let e=(n===`dai.ly`?r[0]:r[0]===`video`?r[1]:r[0]===`embed`&&r[1]===`video`?r[2]:void 0)?.split(`_`)[0];return!e||!bt.test(e)?void 0:{provider:`Dailymotion`,id:e,embedUrl:`https://www.dailymotion.com/embed/video/${e}?autoplay=1`,thumbnail:`https://www.dailymotion.com/thumbnail/video/${e}`}}}function St(e){if(!e)return;let t=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?$/.exec(e);if(!t||!t[0])return;let n=Number(t[1]??0)*3600+Number(t[2]??0)*60+Number(t[3]??0);return n>0?n:void 0}var Q=r(),Ct=6;function wt(e){let t=0;for(let n of e)t=t*31+n.codePointAt(0)>>>0;return t%Ct}function Tt(e){if(e)return e.kind===`image`?e.url:e.poster??xt(e.url)?.thumbnail}function Et(e){return[...e.trim()][0]?.toUpperCase()??`?`}function Dt({entry:e,className:t=``}){let[n,r]=(0,Z.useState)(!1),i=Tt(e.cover),a=e.cover?.kind===`video`&&(0,Q.jsx)(`span`,{className:`rss-cover-play`,children:(0,Q.jsx)(Se,{weight:`fill`})});return!i||n?(0,Q.jsxs)(`span`,{className:`rss-cover-thumbnail rss-cover-letter rss-cover-hue-${wt(e.title)} ${t}`.trim(),"aria-hidden":`true`,children:[Et(e.title),a]}):(0,Q.jsxs)(`span`,{className:`rss-cover-thumbnail ${t}`.trim(),"aria-hidden":`true`,children:[(0,Q.jsx)(`img`,{src:i,alt:``,loading:`lazy`,decoding:`async`,referrerPolicy:`no-referrer`,onError:()=>r(!0)}),a]})}function Ot({entry:e}){let t=e.cover;if(!t)return null;if(t.kind===`image`)return(0,Q.jsx)(`figure`,{className:`rss-cover-media`,children:(0,Q.jsx)(`img`,{src:t.url,alt:``,decoding:`async`,referrerPolicy:`no-referrer`})});let n=xt(t.url);return n?(0,Q.jsx)(At,{entry:e,cover:t,embed:n}):(0,Q.jsx)(kt,{entry:e,cover:t})}function kt({entry:e,cover:t}){let[n,r]=(0,Z.useState)(!1);return n?(0,Q.jsx)(`figure`,{className:`rss-cover-media rss-cover-unplayable`,children:(0,Q.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:`This video cannot play here. Open it`})}):(0,Q.jsx)(`figure`,{className:`rss-cover-media`,children:(0,Q.jsx)(`video`,{src:t.url,poster:t.poster,controls:!0,playsInline:!0,preload:`metadata`,"aria-label":`Video: ${e.title}`,onError:()=>r(!0)})})}function At({entry:e,cover:t,embed:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(!1),s=t.poster??n.thumbnail;return r?(0,Q.jsx)(`figure`,{className:`rss-cover-media rss-cover-embed`,children:(0,Q.jsx)(`iframe`,{src:n.embedUrl,title:`${e.title}, on ${n.provider}`,allow:`autoplay; encrypted-media; picture-in-picture; fullscreen`,allowFullScreen:!0,referrerPolicy:`strict-origin-when-cross-origin`})}):(0,Q.jsx)(`figure`,{className:`rss-cover-media rss-cover-embed`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`rss-cover-embed-start${s&&!a?``:` rss-cover-letter rss-cover-hue-${wt(e.title)}`}`,"aria-label":`Play on ${n.provider}`,onClick:()=>i(!0),children:[s&&!a?(0,Q.jsx)(`img`,{src:s,alt:``,decoding:`async`,referrerPolicy:`no-referrer`,onError:()=>o(!0)}):(0,Q.jsx)(`span`,{className:`rss-cover-embed-letter`,"aria-hidden":`true`,children:Et(e.title)}),(0,Q.jsx)(`span`,{className:`rss-cover-embed-play`,"aria-hidden":`true`,children:(0,Q.jsx)(Se,{weight:`fill`})}),(0,Q.jsxs)(`span`,{className:`rss-cover-embed-caption`,children:[`Plays from `,n.provider]})]})})}var jt=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M230.66,86l-96-64a12,12,0,0,0-13.32,0l-96,64A12,12,0,0,0,20,96V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V96A12,12,0,0,0,230.66,86ZM89.81,152,44,184.31v-65ZM114.36,164h27.28L187,196H69.05ZM166.19,152,212,119.29v65ZM128,46.42l74.86,49.91L141.61,140H114.39L53.14,96.33Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,96l-78.55,56h-34.9L32,96l96-64Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M228.44,89.34l-96-64a8,8,0,0,0-8.88,0l-96,64A8,8,0,0,0,24,96V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V96A8,8,0,0,0,228.44,89.34ZM96.72,152,40,192V111.53Zm16.37,8h29.82l56.63,40H56.46Zm46.19-8L216,111.53V192ZM128,41.61l81.91,54.61-67,47.78H113.11l-67-47.78Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M228.44,89.34l-96-64a8,8,0,0,0-8.88,0l-96,64A8,8,0,0,0,24,96V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V96A8,8,0,0,0,228.44,89.34ZM96.72,152,40,192V111.53Zm16.37,8h29.82l56.63,40H56.46Zm46.19-8L216,111.53V192Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M227.33,91l-96-64a6,6,0,0,0-6.66,0l-96,64A6,6,0,0,0,26,96V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V96A6,6,0,0,0,227.33,91ZM100.18,152,38,195.9V107.65Zm12.27,6h31.1l62.29,44H50.16Zm43.37-6L218,107.65V195.9ZM128,39.21l85.43,57L143.53,146H112.47L42.57,96.17Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M228.44,89.34l-96-64a8,8,0,0,0-8.88,0l-96,64A8,8,0,0,0,24,96V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V96A8,8,0,0,0,228.44,89.34ZM96.72,152,40,192V111.53Zm16.37,8h29.82l56.63,40H56.46Zm46.19-8L216,111.53V192ZM128,41.61l81.91,54.61-67,47.78H113.11l-67-47.78Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M226.22,92.67l-96-64a4,4,0,0,0-4.44,0l-96,64A4,4,0,0,0,28,96V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V96A4,4,0,0,0,226.22,92.67ZM103.63,152,36,199.76v-96Zm8.19,4h32.36l68,48H43.86Zm40.55-4L220,103.76v96ZM128,36.81,217,96.11,144.17,148H111.83L39.05,96.11Z`}))]]),Mt=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:jt}));Mt.displayName=`EnvelopeOpenIcon`;var Nt=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM193.15,68,128,127.72,62.85,68ZM44,188V83.28l75.89,69.57a12,12,0,0,0,16.22,0L212,83.28V188Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,56l-96,88L32,56Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-8,144H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM208.58,62,128,135.86,47.42,62ZM216,194H40a2,2,0,0,1-2-2V69.64l86,78.78a6,6,0,0,0,8.1,0L218,69.64V192A2,2,0,0,1,216,194Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52Zm-10.28,8L128,138.57,42.28,60ZM216,196H40a4,4,0,0,1-4-4V65.09L125.3,147a4,4,0,0,0,5.4,0L220,65.09V192A4,4,0,0,1,216,196Z`}))]]),Pt=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:Nt}));Pt.displayName=`EnvelopeSimpleIcon`;function Ft({label:e,active:t=!1,children:n}){let[r,i]=(0,Z.useState)(!1);return(0,Q.jsx)(v,{open:r,onOpenChange:i,label:e,placement:`bottom-end`,trigger:(0,Q.jsx)(L,{variant:`ghost`,size:`small`,className:`rss-options-trigger${t?` is-active`:``}`,"aria-label":t?`${e} (filtered)`:e,title:e,children:(0,Q.jsx)(ye,{weight:`bold`,"aria-hidden":`true`})}),children:n(()=>i(!1))})}var It={16:`S`,18:`M`,20:`L`,22:`XL`,24:`XXL`},Lt=je.map(e=>({value:String(e),label:It[e]}));function Rt({entry:e,size:t,onSize:n,onOpenOriginal:r,onRead:i,onStar:a,onHide:o,onNote:l}){let u=!!e.custom?.readAt,d=e.custom?.starred===!0,f=e.custom?.hidden===!0;return(0,Q.jsx)(Ft,{label:`Article options`,children:p=>{let m=e=>()=>{p(),e()};return(0,Q.jsxs)(Q.Fragment,{children:[e.link&&(0,Q.jsxs)(c,{onClick:m(r),children:[(0,Q.jsx)(Y,{"aria-hidden":`true`}),`Open the original`]}),(0,Q.jsxs)(c,{onClick:m(()=>i(!u)),children:[u?(0,Q.jsx)(Pt,{"aria-hidden":`true`}):(0,Q.jsx)(Mt,{"aria-hidden":`true`}),u?`Mark as unread`:`Mark as read`]}),(0,Q.jsxs)(c,{onClick:m(()=>a(!d)),children:[(0,Q.jsx)(Ze,{weight:d?`fill`:`regular`,"aria-hidden":`true`}),d?`Unstar`:`Star`]}),l&&(0,Q.jsxs)(c,{onClick:m(l),children:[(0,Q.jsx)(pe,{"aria-hidden":`true`}),`Personal note`]}),(0,Q.jsxs)(c,{onClick:m(()=>o(!f)),children:[f?(0,Q.jsx)(Ce,{"aria-hidden":`true`}):(0,Q.jsx)(we,{"aria-hidden":`true`}),f?`Unhide`:`Hide`]}),(0,Q.jsx)(j,{}),(0,Q.jsx)(s,{choice:{label:`Text size`,icon:(0,Q.jsx)(Te,{}),value:String(t),groups:[{label:`On this device only`,options:Lt}],onChange:e=>n(Number(e))}})]})}})}function zt({previous:e,current:t,next:n,renderSlide:r,onNavigate:i,onScrolledDown:a,handle:o}){let s=(0,Z.useRef)(null),c=[e,t,n].filter(e=>!!e),l=+!!e,u=(0,Z.useRef)({slides:c,current:t,onNavigate:i});return u.current={slides:c,current:t,onNavigate:i},(0,Z.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let t=e.contains(document.activeElement)&&!e.querySelector(`.rss-article-slide.is-current`)?.contains(document.activeElement);e.scrollLeft=l*e.clientWidth,t&&e.querySelector(`.rss-article-slide.is-current`)?.focus({preventScroll:!0})},[t.id,l,e?.id,n?.id]),(0,Z.useEffect)(()=>{let e=s.current;if(!e)return;let t,n=()=>{let t=e.clientWidth;if(!t)return;let n=u.current.slides[Math.round(e.scrollLeft/t)];n&&n.id!==u.current.current.id&&u.current.onNavigate(n.id)},r=`onscrollend`in window,i=()=>{clearTimeout(t),t=setTimeout(n,140)};return r?e.addEventListener(`scrollend`,n):e.addEventListener(`scroll`,i,{passive:!0}),()=>{clearTimeout(t),e.removeEventListener(`scrollend`,n),e.removeEventListener(`scroll`,i)}},[]),(0,Z.useImperativeHandle)(o,()=>({step(t){let r=s.current,a=t===1?n:e;return!r||!a?!1:r.clientWidth?(r.scrollTo({left:(l+t)*r.clientWidth,behavior:`smooth`}),!0):(i(a.id),!0)}}),[l,n,i,e]),(0,Q.jsx)(`div`,{ref:s,className:`rss-article-carousel`,children:c.map(e=>{let n=e.id===t.id;return(0,Q.jsx)(`div`,{className:`rss-article-slide${n?` is-current`:``}`,tabIndex:n?-1:void 0,inert:!n||void 0,"aria-hidden":n?void 0:`true`,onScroll:n&&a?e=>{e.currentTarget.scrollTop>40&&a()}:void 0,children:r(e,n)},e.id)})})}var Bt={"Content-Type":`application/json`,Accept:`application/json`},$={Accept:`application/json`},Vt=(e,t,n=``)=>W(e,`rss/feeds/${encodeURIComponent(t)}${n}`);async function Ht(e,t=fetch){return(await U(W(e,`rss/feeds`),t,{headers:$})).feeds}function Ut(e,t,n=fetch){return U(W(e,`rss/feeds`),n,{method:`POST`,headers:Bt,body:JSON.stringify(t)})}function Wt(e,t,n,r=fetch){return U(Vt(e,t),r,{method:`PATCH`,headers:Bt,body:JSON.stringify(n)})}async function Gt(e,t,n=fetch){await U(Vt(e,t),n,{method:`DELETE`,headers:$})}function Kt(e,t,n=fetch){return U(Vt(e,t,`/fetch`),n,{method:`POST`,headers:$})}async function qt(e,t=fetch){return(await U(W(e,`rss/fetch`),t,{method:`POST`,headers:$})).outcomes}function Jt(e,t={},n=fetch){return U(W(e,`rss/entries`,{...t}),n,{headers:$})}function Yt(e,t=fetch){return U(W(e,`rss/summary`),t,{headers:$})}function Xt(e,t,n,r,i=fetch){return U(Vt(e,t,`/entries/${encodeURIComponent(n)}`),i,{method:`PATCH`,headers:Bt,body:JSON.stringify(r)})}function Zt(e,t,n,r=fetch){return U(Vt(e,t,`/entries/${encodeURIComponent(n)}/article`),r,{headers:$})}function Qt(e,t,n=fetch){return U(W(e,`rss/imap/preview`),n,{method:`POST`,headers:Bt,body:JSON.stringify(t)})}function $t(e){return!!e.link&&e.custom?.article?.status!==`unreadable`}function en(e,t,n){return[`rss-article`,e,t,n]}function tn(e,t,n){let r=$t(t),i=Ve({queryKey:en(e,t.feedId,t.id),queryFn:()=>Zt(e,t.feedId,t.id),enabled:n&&r,staleTime:1/0,gcTime:18e5,retry:!1,refetchOnWindowFocus:!1},V);return{...r&&i.data?{article:i.data}:{},pending:n&&r&&i.isFetching&&!i.data}}var nn={mode:`on`};function rn({vaultId:e,entry:t,load:n}){let{article:r,pending:i}=tn(e,t,n);return i?(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,className:`rss-article-fetching`,children:`Fetching the article…`}):r?.status===`ready`?(0,Q.jsx)(`section`,{className:`rss-article-body`,"aria-label":`Article from the original page`,children:(0,Q.jsx)(Be,{content:r.markdown,externalLinks:nn})}):null}var an=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M246.15,133.18,146.83,33.86A19.85,19.85,0,0,0,132.69,28H40A12,12,0,0,0,28,40v92.69a19.85,19.85,0,0,0,5.86,14.14l99.32,99.32a20,20,0,0,0,28.28,0l84.69-84.69A20,20,0,0,0,246.15,133.18Zm-98.83,93.17L52,131V52h79l95.32,95.32ZM104,88A16,16,0,1,1,88,72,16,16,0,0,1,104,88Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237.66,153,153,237.66a8,8,0,0,1-11.31,0L42.34,138.34A8,8,0,0,1,40,132.69V40h92.69a8,8,0,0,1,5.65,2.34l99.32,99.32A8,8,0,0,1,237.66,153Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63ZM84,96A12,12,0,1,1,96,84,12,12,0,0,1,84,96Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M241.91,137.42,142.59,38.1a13.94,13.94,0,0,0-9.9-4.1H40a6,6,0,0,0-6,6v92.69a13.94,13.94,0,0,0,4.1,9.9l99.32,99.32a14,14,0,0,0,19.8,0l84.69-84.69A14,14,0,0,0,241.91,137.42Zm-8.49,11.31-84.69,84.69a2,2,0,0,1-2.83,0L46.59,134.1a2,2,0,0,1-.59-1.41V46h86.69a2,2,0,0,1,1.41.59l99.32,99.31A2,2,0,0,1,233.42,148.73ZM94,84A10,10,0,1,1,84,74,10,10,0,0,1,94,84Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M240.49,138.83,141.17,39.51A11.93,11.93,0,0,0,132.69,36H40a4,4,0,0,0-4,4v92.69a11.93,11.93,0,0,0,3.51,8.48l99.32,99.32a12,12,0,0,0,17,0l84.69-84.69a12,12,0,0,0,0-17Zm-5.66,11.31-84.69,84.69a4,4,0,0,1-5.65,0L45.17,135.51A4,4,0,0,1,44,132.69V44h88.69a4,4,0,0,1,2.82,1.17l99.32,99.32A4,4,0,0,1,234.83,150.14ZM92,84a8,8,0,1,1-8-8A8,8,0,0,1,92,84Z`}))]]),on=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:an}));on.displayName=`TagIcon`;var sn=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M243.78,156.53l-12-96A28,28,0,0,0,204,36H32A20,20,0,0,0,12,56v88a20,20,0,0,0,20,20H72.58l36.69,73.37A12,12,0,0,0,120,244a44.05,44.05,0,0,0,44-44V188h52a28,28,0,0,0,27.78-31.47ZM68,140H36V60H68Zm151,22.65a4,4,0,0,1-3,1.35H152a12,12,0,0,0-12,12v24a20,20,0,0,1-13.18,18.8L92,149.17V60H204a4,4,0,0,1,4,3.5l12,96A4,4,0,0,1,219,162.65Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M80,48V152H32a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237.83,157.27l-12-96A22,22,0,0,0,204,42H32A14,14,0,0,0,18,56v88a14,14,0,0,0,14,14H76.29l38.34,76.68A6,6,0,0,0,120,238a38,38,0,0,0,38-38V182h58a22,22,0,0,0,21.83-24.73ZM74,146H32a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H74Zm149.5,20.62A9.89,9.89,0,0,1,216,170H152a6,6,0,0,0-6,6v24a26,26,0,0,1-22.42,25.75L86,150.58V54H204a10,10,0,0,1,9.92,8.76l12,96A9.89,9.89,0,0,1,223.5,166.62Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M235.85,157.52l-12-96A20,20,0,0,0,204,44H32A12,12,0,0,0,20,56v88a12,12,0,0,0,12,12H77.53l38.89,77.79A4,4,0,0,0,120,236a36,36,0,0,0,36-36V180h60a20,20,0,0,0,19.85-22.48ZM76,148H32a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H76Zm149,19.94a12,12,0,0,1-9,4.06H152a4,4,0,0,0-4,4v24a28,28,0,0,1-25.58,27.9L84,151.06V52H204a12,12,0,0,1,11.91,10.51l12,96A12,12,0,0,1,225,167.94Z`}))]]),cn=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:sn}));cn.displayName=`ThumbsDownIcon`;var ln=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237,77.47A28,28,0,0,0,216,68H164V56a44.05,44.05,0,0,0-44-44,12,12,0,0,0-10.73,6.63L72.58,92H32a20,20,0,0,0-20,20v88a20,20,0,0,0,20,20H204a28,28,0,0,0,27.78-24.53l12-96A28,28,0,0,0,237,77.47ZM36,116H68v80H36ZM220,96.5l-12,96a4,4,0,0,1-4,3.5H92V106.83L126.82,37.2A20,20,0,0,1,140,56V80a12,12,0,0,0,12,12h64a4,4,0,0,1,4,4.5Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M80,104V208H32a8,8,0,0,1-8-8V112a8,8,0,0,1,8-8Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M232.49,81.44A22,22,0,0,0,216,74H158V56a38,38,0,0,0-38-38,6,6,0,0,0-5.37,3.32L76.29,98H32a14,14,0,0,0-14,14v88a14,14,0,0,0,14,14H204a22,22,0,0,0,21.83-19.27l12-96A22,22,0,0,0,232.49,81.44ZM30,200V112a2,2,0,0,1,2-2H74v92H32A2,2,0,0,1,30,200ZM225.92,97.24l-12,96A10,10,0,0,1,204,202H86V105.42l37.58-75.17A26,26,0,0,1,146,56V80a6,6,0,0,0,6,6h64a10,10,0,0,1,9.92,11.24Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M231,82.76A20,20,0,0,0,216,76H156V56a36,36,0,0,0-36-36,4,4,0,0,0-3.58,2.21L77.53,100H32a12,12,0,0,0-12,12v88a12,12,0,0,0,12,12H204a20,20,0,0,0,19.85-17.52l12-96A20,20,0,0,0,231,82.76ZM76,204H32a4,4,0,0,1-4-4V112a4,4,0,0,1,4-4H76ZM227.91,97.49l-12,96A12,12,0,0,1,204,204H84V104.94L122.42,28.1A28,28,0,0,1,148,56V80a4,4,0,0,0,4,4h64a12,12,0,0,1,11.91,13.49Z`}))]]),un=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:ln}));un.displayName=`ThumbsUpIcon`;function dn({entry:e,availableTags:t=[],onSave:n,onCancel:r}){let i=(e.custom?.tags??[]).map(e=>e.toLowerCase()),a=t.filter(e=>!i.includes(e.toLowerCase())),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(new Set),[u,f]=(0,Z.useState)(!1),p=(0,Z.useRef)(null),m=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},h=async()=>{if(!u){f(!0);try{let e=rt(o);await n(Array.from(new Set([...i,...Array.from(c),...e]))),r()}finally{f(!1)}}};return(0,Q.jsx)(d,{title:`Add tags`,size:`small`,mobilePresentation:`sheet`,busy:u,initialFocusRef:p,onCancel:r,actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(g,{disabled:u,onClick:r,children:`Cancel`}),(0,Q.jsx)(g,{primary:!0,disabled:u,onClick:()=>void h(),children:`Apply`})]}),children:(0,Q.jsxs)(`div`,{className:`rss-tag-popup-content`,children:[(0,Q.jsx)(M,{label:`New tags`,description:`Add non-existing tags, separated by commas.`,children:(0,Q.jsx)(D,{ref:p,autoComplete:`off`,value:o,placeholder:`ai, news, robotics`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),h())}})}),(0,Q.jsxs)(`div`,{className:`rss-tag-popup-existing`,children:[(0,Q.jsx)(I,{size:`small`,weight:`medium`,tone:`muted`,children:`Existing tags`}),a.length>0?(0,Q.jsx)(`div`,{className:`rss-tag-popup-chips`,role:`group`,"aria-label":`Existing tags`,children:a.map(e=>{let t=c.has(e);return(0,Q.jsx)(N,{size:`small`,title:e,color:t?`primary`:`neutral`,className:t?`rss-tag-chip-selected`:void 0,onClick:()=>m(e)},e)})}):(0,Q.jsx)(I,{size:`caption`,tone:`muted`,children:t.length===0?`No other tags exist yet in your feeds.`:`All existing tags are already added to this entry.`})]})]})})}var fn=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),pn=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:fn}));pn.displayName=`StopIcon`;function mn(e,t){let n=ne(),r=!!(n.data?.enabled&&n.data.activeProviderId),[i,a]=(0,Z.useState)(`idle`),[o,s]=(0,Z.useState)(),c=(0,Z.useRef)(void 0),l=(0,Z.useRef)(void 0),u=(0,Z.useRef)(t);u.current=t;let d=(0,Z.useCallback)(()=>{l.current?.abort(),l.current=void 0,c.current?.cancel(),c.current=void 0,a(`idle`)},[]);(0,Z.useEffect)(()=>d,[d]);let f=(0,Z.useCallback)(()=>{if(i===`recording`){a(`transcribing`),c.current?.stop();return}if(i!==`idle`||!r)return;s(void 0);let t;try{t=A(H)}catch(e){s(G(e));return}c.current=t,a(`recording`),t.result.then(async t=>{if(c.current=void 0,!t){a(`idle`);return}let n=new AbortController;l.current=n,a(`transcribing`);try{let r=await oe(e,t,n.signal);!n.signal.aborted&&r.text.trim()&&u.current(r.text.trim())}catch(e){n.signal.aborted||s(G(e))}finally{l.current===n&&(l.current=void 0),a(`idle`)}},e=>{c.current=void 0,s(G(e)),a(`idle`)})},[r,i,e]);return{available:r,phase:i,...o?{error:o}:{},toggle:f,cancel:d}}function hn({vaultId:e,value:t,initial:n,onSave:r,onRemove:i,onCancel:a}){let[o,s]=(0,Z.useState)(n),[c,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(null),f=mn(e,e=>s(t=>t.trim()?`${t.trimEnd()} ${e}`:e)),p=async e=>{if(!c){l(!0);try{await e()}finally{l(!1)}}},m=()=>p(()=>r(o.trim()));return(0,Q.jsx)(d,{title:t===`like`?`Why do you like it?`:`Why don’t you like it?`,size:`small`,mobilePresentation:`sheet`,busy:c,initialFocusRef:u,onCancel:a,actions:(0,Q.jsxs)(Q.Fragment,{children:[i&&(0,Q.jsx)(g,{disabled:c,onClick:()=>void p(i),children:t===`like`?`Remove like`:`Remove dislike`}),i&&(0,Q.jsx)(h,{}),(0,Q.jsx)(g,{disabled:c,onClick:a,children:`Cancel`}),(0,Q.jsx)(g,{primary:!0,disabled:c||f.phase!==`idle`,onClick:()=>void m(),children:t===`like`?`Like it`:`Dislike it`})]}),children:(0,Q.jsxs)(M,{label:`Reason`,optional:!0,description:`Kept with the entry; later it can teach what you like.`,error:f.error,children:[(0,Q.jsxs)(`div`,{className:`rss-reason-field`,children:[(0,Q.jsx)(O,{ref:u,rows:4,value:o,readOnly:f.phase===`transcribing`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())}}),f.available&&(0,Q.jsx)(L,{variant:f.phase===`recording`?`danger`:`ghost`,size:`small`,className:`rss-reason-dictate`,disabled:f.phase===`transcribing`,"aria-label":f.phase===`recording`?`Stop and transcribe`:f.phase===`transcribing`?`Transcribing`:`Dictate the reason`,onClick:f.toggle,children:f.phase===`recording`?(0,Q.jsx)(pn,{weight:`fill`,"aria-hidden":`true`}):(0,Q.jsx)(He,{"aria-hidden":`true`})})]}),f.phase!==`idle`&&(0,Q.jsx)(I,{size:`caption`,tone:`muted`,role:`status`,children:f.phase===`recording`?`Recording…`:`Transcribing…`})]})})}function gn({vaultId:e,entry:t,availableTags:n=[],onFeedback:r,onOpenNote:i}){let a=t.custom?.rating,o=(t.custom?.tags??[]).map(e=>e.toLowerCase()),s=!!t.custom?.note?.trim(),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(!1),f=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let e=f.current;if(!e)return;let t=e.closest(`.rss-article-slide`),n=e.previousElementSibling;if(!t||!n)return;let r=!1,i=t=>{r!==t&&(r=t,e.classList.toggle(`is-stuck`,t))};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(([e])=>{let t=!e.isIntersecting&&e.boundingClientRect.bottom<=(e.rootBounds?.top??0)+1;i(t)},{root:t,threshold:[0]});return e.observe(n),()=>e.disconnect()}let a=()=>{let e=t.getBoundingClientRect(),r=n.getBoundingClientRect();i(r.bottom<=e.top+1)};return t.addEventListener(`scroll`,a,{passive:!0}),()=>t.removeEventListener(`scroll`,a)},[]),(0,Q.jsxs)(`div`,{ref:f,className:`rss-article-sticky-bar`,role:`toolbar`,"aria-label":`Article actions`,children:[(0,Q.jsxs)(`div`,{className:`rss-sticky-left-group`,children:[(0,Q.jsx)(L,{variant:s?`primary-soft`:`ghost`,size:`small`,"aria-label":s?`Edit personal note`:`Add personal note`,title:s?`Edit personal note`:`Add personal note`,onClick:i,children:(0,Q.jsx)(pe,{"aria-hidden":`true`})}),o.length===0?(0,Q.jsx)(L,{variant:`ghost`,size:`small`,"aria-label":`Add tags`,title:`Add tags`,onClick:()=>d(!0),children:(0,Q.jsx)(on,{"aria-hidden":`true`})}):(0,Q.jsx)(T,{variant:`ghost`,size:`small`,className:`rss-sticky-tags-button`,"aria-label":`Tags: ${o.join(`, `)}`,title:`Tags: ${o.join(`, `)} (click to edit)`,onClick:()=>d(!0),children:(0,Q.jsx)(I,{size:`small`,tone:`muted`,className:`rss-sticky-tags-text`,children:o.join(`, `)})})]}),(0,Q.jsxs)(`div`,{className:`rss-sticky-right-group`,children:[(0,Q.jsx)(_n,{value:`like`,rating:a?.value,onPress:l}),(0,Q.jsx)(_n,{value:`dislike`,rating:a?.value,onPress:l})]}),u&&(0,Q.jsx)(dn,{entry:t,availableTags:n,onSave:async e=>{await r({tags:e})},onCancel:()=>d(!1)}),c&&(0,Q.jsx)(hn,{vaultId:e,value:c,initial:a?.value===c?a.reason??``:``,onCancel:()=>l(void 0),...a?.value===c?{onRemove:async()=>{await r({rating:null}),l(void 0)}}:{},onSave:async e=>{await r({rating:{value:c,...e?{reason:e}:{}}}),l(void 0)}})]})}function _n({value:e,rating:t,onPress:n}){let r=e===`like`?`Like`:`Dislike`;return(0,Q.jsx)(L,{variant:t===e?`primary-soft`:`ghost`,size:`small`,"aria-label":r,"aria-pressed":t===e,title:r,onClick:()=>n(e),children:e===`like`?(0,Q.jsx)(un,{weight:t===e?`fill`:`regular`,"aria-hidden":`true`}):(0,Q.jsx)(cn,{weight:t===e?`fill`:`regular`,"aria-hidden":`true`})})}var vn=5e3;function yn({vaultId:e,entry:t,onSave:n,onCancel:r}){let i=t.custom?.note??``,a=t.custom?.noteReplacesSummary===!0,[o,s]=(0,Z.useState)(i),[c,l]=(0,Z.useState)(a),[u,f]=(0,Z.useState)(!1),p=(0,Z.useRef)(null),m=mn(e,e=>s(t=>t.trim()?`${t.trimEnd()} ${e}`:e)),h=async()=>{if(!u){f(!0);try{let e=o.trim();await n(e||null,e?c:!1),r()}finally{f(!1)}}};return(0,Q.jsxs)(d,{title:`Personal note`,size:`small`,busy:u,initialFocusRef:p,onCancel:r,actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(g,{disabled:u,onClick:r,children:`Cancel`}),(0,Q.jsx)(g,{primary:!0,disabled:u||m.phase!==`idle`,onClick:()=>void h(),children:`Save note`})]}),children:[(0,Q.jsx)(k,{className:`rss-entry-note-replace`,checked:c,disabled:!o.trim(),onCheckedChange:l,children:`Replace description in feed`}),(0,Q.jsxs)(M,{label:`Note`,description:`A note of your own on this entry.`,error:m.error,children:[(0,Q.jsxs)(`div`,{className:`rss-reason-field`,children:[(0,Q.jsx)(O,{ref:p,rows:5,maxLength:vn,value:o,placeholder:`Add your note here...`,readOnly:m.phase===`transcribing`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())}}),m.available&&(0,Q.jsx)(L,{variant:m.phase===`recording`?`danger`:`ghost`,size:`small`,className:`rss-reason-dictate`,disabled:m.phase===`transcribing`,"aria-label":m.phase===`recording`?`Stop and transcribe`:m.phase===`transcribing`?`Transcribing`:`Dictate the note`,onClick:m.toggle,children:m.phase===`recording`?(0,Q.jsx)(pn,{weight:`fill`,"aria-hidden":`true`}):(0,Q.jsx)(He,{"aria-hidden":`true`})})]}),m.phase!==`idle`&&(0,Q.jsx)(I,{size:`caption`,tone:`muted`,role:`status`,children:m.phase===`recording`?`Recording…`:`Transcribing…`})]})]})}var bn=()=>Promise.resolve();function xn({vaultId:e,entry:t,availableTags:n,previous:r,next:i,resize:a,onFeedback:s,onHide:c,onRead:l,onNavigate:u,onScrolledDown:d,carousel:f,onShowList:p,onClose:m}){let h=gt(t),[g,_]=ae(De),[v,y]=(0,Z.useState)(void 0),b=t.custom?.starred===!0;return(0,Q.jsxs)(o,{className:`rss-article-panel`,keyboardLayer:!0,detailView:!0,headerShade:!1,leading:p?(0,Q.jsx)(L,{variant:`ghost`,size:`small`,className:`rss-article-list-lead`,"aria-label":`Show the list`,title:`Show the list`,onClick:p,children:(0,Q.jsx)(fe,{"aria-hidden":`true`})}):(0,Q.jsx)(L,{variant:b?`primary-soft`:`ghost`,size:`small`,className:`rss-article-star-lead`,"aria-label":b?`Unstar`:`Star`,"aria-pressed":b,title:b?`Unstar`:`Star`,onClick:()=>void s({starred:!b}),children:(0,Q.jsx)(Ze,{weight:b?`fill`:`regular`,"aria-hidden":`true`})}),title:t.feedTitle,subtitle:h,resize:a,onClose:m,closeLabel:`Close article`,bodyLabel:`Article`,bodyClassName:`rss-article-carousel-body`,swipeDismissFrom:`edge`,actions:(0,Q.jsx)(Rt,{entry:t,size:g,onSize:_,onOpenOriginal:()=>void _t(t),onRead:l,onHide:c,onStar:e=>void s({starred:e}).catch(()=>void 0),onNote:()=>y(t)}),children:[(0,Q.jsx)(zt,{previous:r,current:t,next:i,renderSlide:(t,r)=>(0,Q.jsx)(Sn,{vaultId:e,entry:t,size:g,availableTags:n,loadArticle:r||t.id===i?.id,onFeedback:r?s:bn,onOpenNote:()=>y(t)}),onNavigate:u,onScrolledDown:d,handle:f}),v&&(0,Q.jsx)(yn,{vaultId:e,entry:v,onSave:async(e,t)=>{await s({note:e,noteReplacesSummary:t})},onCancel:()=>y(void 0)})]})}function Sn({vaultId:e,entry:t,size:n,availableTags:r,loadArticle:i,onFeedback:a,onOpenNote:o}){let s=[t.feedTitle,t.author,gt(t)].filter(Boolean).join(` · `);return(0,Q.jsxs)(`article`,{className:`rss-article`,style:{fontSize:`${n}px`},children:[(0,Q.jsx)(Ot,{entry:t},`cover-${t.id}`),(0,Q.jsxs)(`header`,{className:`rss-article-header`,children:[(0,Q.jsx)(F,{as:`h1`,size:`page`,children:t.title}),(0,Q.jsx)(I,{size:`small`,tone:`muted`,className:`rss-article-byline`,children:s})]}),(0,Q.jsx)(gn,{vaultId:e,entry:t,availableTags:r,onFeedback:a,onOpenNote:o},`sticky-${t.id}`),t.content?.length?t.content.map((e,t)=>(0,Q.jsx)(`p`,{children:e},t)):t.summary?(0,Q.jsx)(`p`,{children:t.summary}):(0,Q.jsx)(I,{as:`p`,tone:`muted`,children:`This entry has no text of its own.`}),t.link&&(0,Q.jsx)(`a`,{className:`rss-article-link`,href:t.link,target:`_blank`,rel:`noreferrer`,children:`Open the original`}),(0,Q.jsx)(rn,{vaultId:e,entry:t,load:i})]})}var Cn=180;function wn({label:e,entries:t,size:n,selected:r,active:i,motion:a=!1,onSelect:o}){let s=(0,Z.useRef)(null),c=t.filter(e=>e.leftAt!==void 0).length,l=(0,Z.useRef)(c);return(0,Z.useLayoutEffect)(()=>{a&&l.current>0&&c===0&&s.current?.animate?.([{opacity:.25},{opacity:1}],{duration:Cn,easing:`ease-out`}),l.current=c},[a,c]),(0,Q.jsx)(`ul`,{ref:s,className:`rss-entry-grid rss-entry-grid-${n}`,"aria-label":e,children:t.map(({item:{entry:e,read:t,hidden:n},leftAt:a})=>(0,Q.jsx)(`li`,{"aria-hidden":a!==void 0||void 0,className:[t?`is-read`:``,n?`is-hidden`:``,a===void 0?``:`is-leaving`].filter(Boolean).join(` `)||void 0,children:(0,Q.jsxs)(T,{variant:`ghost`,className:`rss-entry-card${e.id===r?` is-selected`:``}`,"aria-label":`Read ${e.title}`,"aria-current":e.id===r||void 0,"data-keyboard-item":i&&a===void 0?`true`:void 0,onClick:()=>o(e.id),children:[(0,Q.jsx)(Dt,{entry:e,className:`rss-entry-card-cover`}),n&&(0,Q.jsxs)(`span`,{className:`rss-entry-hidden-badge`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),` Hidden`]}),(0,Q.jsx)(`span`,{className:`rss-entry-card-title`,children:e.title}),gt(e)&&(0,Q.jsx)(`span`,{className:`rss-entry-card-date`,children:gt(e)})]})},e.id))})}function Tn(e,t,n,r){let i=new Set(t.map(n)),a=new Map,o=null;for(let t of e){let e=n(t.item);if(i.has(e)){o=e;continue}let s=a.get(o)??[];s.push({item:t.item,leftAt:t.leftAt??r}),a.set(o,s)}let s=[...a.get(null)??[]];for(let e of t)s.push({item:e},...a.get(n(e))??[]);return s}function En(e,t,n){return e.filter(e=>e.leftAt===void 0||t-e.leftAt<n)}function Dn(e,t,n,r,i,a=!1){let[o,s]=(0,Z.useState)(()=>({items:e,scope:n,animate:r,hold:a,displayed:e?.map(e=>({item:e}))})),c=o;if(o.items!==e||o.scope!==n||o.animate!==r||o.hold!==a){let i=performance.now(),l=r&&o.animate&&o.scope===n&&o.displayed&&e,u=l?Tn(o.displayed,e,t,i):e?.map(e=>({item:e}));l&&o.hold&&!a&&(u=u?.map(e=>e.leftAt===void 0?e:{...e,leftAt:i})),c={items:e,scope:n,animate:r,hold:a,displayed:u},s(c)}let l=c.displayed;return(0,Z.useEffect)(()=>{if(!l||a)return;let e=l.flatMap(e=>e.leftAt===void 0?[]:[e.leftAt]);if(!e.length)return;let t=Math.max(0,Math.max(...e)+i-performance.now()),n=setTimeout(()=>s(e=>e.displayed===l?{...e,displayed:En(l,performance.now(),i)}:e),t);return()=>clearTimeout(n)},[l,i,a]),l}function On(){return!le(`(prefers-reduced-motion: reduce)`)}var kn=320,An=260,jn=e=>e.entry.id,Mn=600;function Nn({source:e,entries:t,selected:n,active:r,resize:i,display:a,actions:s,notice:c,listScope:u=``,emptyMessage:d,error:p,total:m,unread:h,hasMore:g=!1,loadingMore:_=!1,onLoadMore:v,onSelect:y,onClose:b}){let x=`${e.title} list`,S=On(),C=a?.layout===`grid`,w=ue(),E=!!n&&(C||w),D=Dn(t,jn,`${e.id}\n${u}`,S,C?An:kn,E),O=e=>e!==void 0&&!(E&&!C),k=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{C||k.current?.querySelectorAll(`li.is-leaving:not([data-rss-leaving])`).forEach(e=>{e.dataset.rssLeaving=`true`;let t=`${e.offsetHeight}px`,n=getComputedStyle(e).opacity;e.animate?.([{height:t,opacity:n,transform:`none`},{height:t,opacity:0,transform:`translateX(-12px) scale(.98)`,offset:.4},{height:`0px`,opacity:0,transform:`translateX(-12px) scale(.98)`}],{duration:kn,easing:`cubic-bezier(.4, 0, .2, 1)`,fill:`forwards`})})},[D,C]),(0,Z.useEffect)(()=>{n&&k.current?.querySelector(`.selected, .is-selected`)?.scrollIntoView?.({block:`nearest`,behavior:S?`smooth`:`auto`})},[n,S]);let A=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{let e=A.current;if(!e||!g||_||!v||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&v()},{root:k.current,rootMargin:`0px 0px ${Mn}px 0px`});return t.observe(e),()=>t.disconnect()},[g,_,v,t?.length]);let j=p?(0,Q.jsx)(f,{status:`error`,children:p}):!t||!D?(0,Q.jsx)(f,{status:`loading`,children:`Loading entries…`}):D.length?a?.layout===`grid`?(0,Q.jsx)(wn,{label:x,entries:D,size:a.gridSize,selected:n,active:r,motion:S,onSelect:y}):(0,Q.jsx)(l,{"aria-label":x,edgeToEdge:!0,items:D.map(({item:{entry:t,read:i,hidden:a},leftAt:o})=>({id:t.id,title:t.title,description:Fe(t),leading:(0,Q.jsx)(Dt,{entry:t}),selected:t.id===n,keyboardItem:r&&o===void 0,subtitle:(0,Q.jsxs)(Q.Fragment,{children:[a&&(0,Q.jsxs)(`span`,{className:`rss-entry-hidden-mark`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),` Hidden ·`]}),[e.kind===`view`?t.feedTitle:void 0,gt(t)].filter(Boolean).join(` · `)]}),className:[i||o!==void 0?`is-read`:``,a?`is-hidden`:``,O(o)?`is-leaving`:``].filter(Boolean).join(` `)||void 0,ariaLabel:`Read ${t.title}`})),onSelect:y}):(0,Q.jsx)(f,{status:`empty`,heading:`No entries yet`,children:d??(e.kind===`view`?`Entries from the feeds this vault follows appear here.`:`This feed has published nothing yet.`)}),ee=e=>{if(e.key!==` `||e.altKey||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||!D)return;let t=e.target instanceof HTMLElement?e.target.closest(`li`):null;t?.parentElement&&e.target instanceof HTMLButtonElement&&(e.preventDefault(),e.type===`keydown`&&!e.repeat&&_t(D[[...t.parentElement.children].indexOf(t)]?.item.entry))},M=m===void 0?void 0:ut(m,h,!ct(e.id));return(0,Q.jsxs)(o,{className:`rss-entries-panel`,detailView:r,headerShade:!1,title:e.title,subtitle:M,actions:s,onClose:b,resize:i,closeLabel:`Close ${e.title}`,bodyLabel:`Entries`,bodyRef:k,children:[c&&(0,Q.jsx)(I,{as:`div`,size:`caption`,tone:`muted`,className:`rss-entries-notice`,role:`status`,children:c}),(0,Q.jsx)(`div`,{className:`rss-entries-keys`,onKeyDown:ee,onKeyUp:ee,children:j}),t&&g&&(0,Q.jsx)(`div`,{ref:A,className:`rss-entries-more`,children:(0,Q.jsx)(T,{variant:`ghost`,size:`small`,disabled:_,onClick:v,children:_?`Loading older entries…`:`Load older entries`})})]})}function Pn(e){if(e.matching===0)return`No unread email matches this source yet.`;let t=e.matching===1?`1 unread email matches`:`${e.matching.toLocaleString(`en`)} unread emails match`,n=e.emails.length;return`${t} this source. ${n===e.matching?n===1?`It reads`:`They read`:`The newest ${n} read`} as follows; nothing is kept or marked read.`}function Fn(e){let t=e.matches.find(t=>t.parser===e.parser);if(!t){let t=e.matches.find(e=>e.score>0);return`No newsletter parser recognised it, so it becomes one entry.${t?` The nearest, ${t.label}, scored ${t.score} of the ${t.threshold} it needs.`:``}`}return`Matched with ${t.score} (needs ${t.threshold}): ${t.reasons.join(`; `)}.`}function In(e){let t=e.entries.length;return t===1?`1 entry`:`${t} entries`}function Ln(e){if(e)try{return new URL(e).hostname.replace(/^www\./,``)}catch{return}}function Rn({preview:e}){return(0,Q.jsxs)(`div`,{className:`rss-source-preview`,children:[(0,Q.jsx)(I,{as:`p`,tone:`muted`,children:Pn(e)}),e.emails.map(e=>(0,Q.jsxs)(`section`,{className:`rss-source-preview-email`,"aria-label":e.subject,children:[(0,Q.jsxs)(`header`,{className:`rss-source-preview-email-header`,children:[(0,Q.jsx)(F,{as:`h3`,size:`subsection`,children:e.subject||`No subject`}),(0,Q.jsxs)(`div`,{className:`rss-source-preview-email-meta`,children:[(0,Q.jsx)(N,{size:`small`,color:e.parser===`generic`?`neutral`:`primary`,title:e.parserLabel}),(0,Q.jsxs)(I,{as:`span`,size:`caption`,tone:`muted`,children:[In(e),` · `,new Date(e.published).toLocaleDateString()]})]}),(0,Q.jsx)(I,{as:`p`,size:`caption`,tone:`muted`,children:Fn(e)}),e.skipped&&(0,Q.jsxs)(I,{as:`p`,size:`caption`,tone:`warning`,children:[`A fetch would skip it: `,e.skipped,`.`]})]}),e.entries.length>0&&(0,Q.jsx)(`ol`,{className:`rss-source-preview-entries`,children:e.entries.map((e,t)=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(I,{as:`p`,weight:`semibold`,children:e.title}),e.summary&&(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,className:`rss-source-preview-summary`,children:e.summary}),(e.categories?.length||e.link)&&(0,Q.jsx)(I,{as:`p`,size:`caption`,tone:`muted`,children:[e.categories?.join(`, `),Ln(e.link)].filter(Boolean).join(` · `)})]},`${e.link??``}-${t}`))})]},e.uid))]})}function zn({source:e,onPreview:t,onClose:n}){let[r,i]=(0,Z.useState)({status:`loading`});return(0,Z.useEffect)(()=>{let n=!0;return t(e).then(e=>{n&&i({status:`ready`,preview:e})}).catch(e=>{n&&i({status:`error`,message:G(e)})}),()=>{n=!1}},[e,t]),(0,Q.jsxs)(d,{title:`Source preview`,description:`The newest emails this source matches, read as a fetch would read them.`,size:`large`,scrollableBody:!0,onCancel:n,closeLabel:`Close the source preview`,actions:(0,Q.jsx)(g,{primary:!0,onClick:n,children:`Close`}),children:[r.status===`loading`&&(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`Reading the newest emails. A throttled mailbox can take a minute.`}),r.status===`error`&&(0,Q.jsx)(f,{status:`error`,density:`inline`,children:r.message}),r.status===`ready`&&(0,Q.jsx)(Rn,{preview:r.preview})]})}var Bn=[{value:`all`,label:`All emails`},{value:`unread`,label:`Unread only`}];function Vn({accounts:e,values:t,error:n,saving:r,sendersRef:i,onChange:a}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(M,{label:`Email account`,description:`Account configured in Settings › Email accounts.`,error:n,children:e.length===0?(0,Q.jsx)(I,{as:`p`,tone:`danger`,size:`caption`,children:`No email accounts configured yet. Please configure an account in Settings first.`}):(0,Q.jsx)(P,{value:t.account,disabled:r,onChange:e=>a({account:e.target.value}),children:e.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.label,` (`,e.username,`)`]},e.id))})}),(0,Q.jsx)(M,{label:`Mailbox folder`,optional:!0,description:`The folder or Gmail label to read. Default: INBOX.`,children:(0,Q.jsx)(D,{autoComplete:`off`,value:t.mailbox,placeholder:`INBOX`,readOnly:r,onChange:e=>a({mailbox:e.target.value})})}),(0,Q.jsxs)(`div`,{className:`rss-feed-form-pair`,children:[(0,Q.jsx)(M,{label:`Sender addresses`,optional:!0,children:(0,Q.jsx)(D,{ref:i,autoComplete:`off`,spellCheck:!1,value:t.senders,placeholder:`dan@tldr.tech, *@substack.com`,readOnly:r,onChange:e=>a({senders:e.target.value})})}),(0,Q.jsx)(M,{label:`Sender names`,optional:!0,children:(0,Q.jsx)(D,{autoComplete:`off`,value:t.senderNames,placeholder:`=TLDR, Lenny*`,readOnly:r,onChange:e=>a({senderNames:e.target.value})})})]}),(0,Q.jsx)(M,{label:`Subjects`,optional:!0,children:(0,Q.jsx)(D,{autoComplete:`off`,value:t.subjects,placeholder:`weekly, -sponsor`,readOnly:r,onChange:e=>a({subjects:e.target.value})})}),(0,Q.jsx)(I,{as:`p`,size:`caption`,tone:`muted`,children:`Separate patterns with commas. Text matches anywhere, ignoring case; =text matches exactly that and nothing longer, * stands for anything, a leading - excludes, and “quotes” keep commas. An email must pass every filter you fill in; left empty, a filter lets every unread email through.`}),(0,Q.jsx)(M,{label:`Emails to read`,description:t.emails===`all`?`Every email in the folder that passes the filters, read or not. Each is processed once.`:`Only emails still unread in the folder: one you open in your mail app first is never read here.`,children:(0,Q.jsx)(E,{label:`Emails to read`,value:t.emails,options:Bn,disabled:r,onValueChange:e=>a({emails:e})})}),(0,Q.jsx)(M,{label:`Mailbox options`,children:(0,Q.jsx)(k,{className:`rss-feed-form-switch`,checked:t.markAsRead,onCheckedChange:e=>a({markAsRead:e}),disabled:r,children:`Mark emails as read in mailbox after import`})})]})}function Hn(e){let t=[],n=``,r=!1;for(let i of e)i===`"`&&(r=!r),i===`,`&&!r?(t.push(n),n=``):n+=i;return t.push(n),t.map(e=>e.trim()).filter(Boolean)}function Un(e){return(e??[]).join(`, `)}var Wn=[{value:`rss`,label:`Web feed`},{value:`imap`,label:`Email newsletter`}];function Gn({feed:e,copyOf:t,onSubmit:n,onSaved:r}){let i=e??t,[a,o]=(0,Z.useState)(i?.type??`rss`),[s,c]=(0,Z.useState)(i?.url??``),[l,u]=(0,Z.useState)(i?.title??``),[d,f]=(0,Z.useState)(i?.refreshMinutes??30),[p,m]=(0,Z.useState)((i?.tags??[]).join(`, `)),[h,g]=(0,Z.useState)(i?.display.layout??et.layout),[_,v]=(0,Z.useState)(i?.display.gridSize??et.gridSize),[y,b]=(0,Z.useState)([]),[x,S]=(0,Z.useState)(i?.account??``),[C,w]=(0,Z.useState)(i?.mailbox??`INBOX`),[T,O]=(0,Z.useState)(Un(i?.rules?.senders)),[k,A]=(0,Z.useState)(Un(i?.rules?.senderNames)),[j,ee]=(0,Z.useState)(Un(e?.rules?.subjects)),[N,te]=(0,Z.useState)(i?.rules?.markAsRead??!1),[F,ne]=(0,Z.useState)(i?.rules?.emails??(i?`unread`:`all`)),[re,L]=(0,Z.useState)(),[R,ie]=(0,Z.useState)(!1),z=(0,Z.useRef)(null),B=(0,Z.useRef)(null),V=(0,Z.useRef)(null),H=!!e;(0,Z.useEffect)(()=>{Ue().then(t=>{b(t),!x&&t.length>0&&S(t[0].id),!e&&t.length===0&&o(`rss`)}).catch(()=>void 0)},[x,e]);async function ae(e){if(e?.preventDefault(),R)return;if(a===`rss`){if(!s.trim()){L(`Paste the address of a feed, or of a site that has one.`),z.current?.focus();return}}else{if(y.length===0){L(`No email accounts configured. Please configure an account in Settings first.`);return}if(!x){L(`Select an email account or configure one in Settings.`);return}}ie(!0),L(void 0);let t=Kn({senders:T,senderNames:k,subjects:j},N,F);try{r(await n({type:a,...a===`rss`?{url:s.trim()}:{account:x,mailbox:C.trim()||`INBOX`,rules:t},title:l.trim(),refreshMinutes:d,tags:rt(p),display:{layout:h,gridSize:_}}))}catch(e){L(G(e)),ie(!1),a===`rss`?z.current?.focus():B.current?.focus()}}let oe=(0,Q.jsxs)(Q.Fragment,{children:[!H&&y.length>0&&(0,Q.jsx)(M,{label:`Source type`,children:(0,Q.jsx)(E,{label:`Feed source type`,value:a,options:Wn,disabled:R,onValueChange:o})}),a===`rss`?(0,Q.jsx)(M,{label:`Address`,description:`The feed’s own address, or a site that names its feed: the site’s first feed is followed.`,error:re,children:(0,Q.jsx)(D,{ref:z,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,value:s,placeholder:`https://`,readOnly:R,onChange:e=>{c(e.target.value),L(void 0)}})}):(0,Q.jsx)(Vn,{accounts:y,values:{account:x,senders:T,senderNames:k,subjects:j,mailbox:C,emails:F,markAsRead:N},error:re,saving:R,sendersRef:B,onChange:e=>{e.account!==void 0&&S(e.account),e.senders!==void 0&&O(e.senders),e.mailbox!==void 0&&w(e.mailbox),e.senderNames!==void 0&&A(e.senderNames),e.subjects!==void 0&&ee(e.subjects),e.markAsRead!==void 0&&te(e.markAsRead),e.emails!==void 0&&ne(e.emails)}}),(0,Q.jsx)(M,{label:`Title`,optional:!0,description:`Left empty, the feed or sender name shows.`,children:(0,Q.jsx)(D,{ref:V,autoComplete:`off`,value:l,placeholder:e?.feedTitle??(a===`imap`?`Newsletter`:`From the feed`),readOnly:R,onChange:e=>u(e.target.value)})}),(0,Q.jsx)(M,{label:`Tags`,optional:!0,description:`Separated by commas. Views gather entries across feeds by tag.`,children:(0,Q.jsx)(D,{autoComplete:`off`,value:p,placeholder:`news, newsletters`,readOnly:R,onChange:e=>m(e.target.value)})}),(0,Q.jsx)(M,{label:`Refresh`,description:`How often this vault fetches the feed in the background, as it does for external calendars.`,children:(0,Q.jsx)(P,{value:String(d),disabled:R,onChange:e=>f(Number(e.target.value)),children:$e(d).map(e=>(0,Q.jsx)(`option`,{value:e.minutes,children:e.label},e.minutes))})}),(0,Q.jsxs)(`div`,{className:`rss-feed-form-display`,children:[(0,Q.jsx)(E,{label:`Entries show as`,value:h,options:tt,disabled:R,onValueChange:g}),h===`grid`&&(0,Q.jsx)(E,{label:`Grid size`,value:_,options:nt,disabled:R,onValueChange:v})]}),(0,Q.jsx)(I,{as:`p`,size:`caption`,tone:`muted`,children:`The feed definition and settings are saved in the vault, so they travel with every copy of it.`})]});return{saving:R,emailSource:(0,Z.useMemo)(()=>a===`imap`&&x?{account:x,mailbox:C.trim()||`INBOX`,rules:Kn({senders:T,senderNames:k,subjects:j},N,F)}:void 0,[a,x,C,T,k,j,N,F]),firstFieldRef:H?V:a===`rss`?z:B,submit:ae,fields:oe}}function Kn(e,t,n=`all`){let r=Hn(e.senders),i=Hn(e.senderNames),a=Hn(e.subjects);return{...r.length?{senders:r}:{},...i.length?{senderNames:i}:{},...a.length?{subjects:a}:{},emails:n,markAsRead:t}}function qn({feed:e,copyOf:t,onSubmit:n,onSaved:r,onRemove:i,onCancel:a,onPreview:o}){let s=Gn({feed:e,copyOf:t,onSubmit:n,onSaved:r}),c=(0,Z.useId)(),l=!!e,[u,f]=(0,Z.useState)();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(d,{title:l?`Edit feed`:t?`Duplicate feed`:`Add feed`,size:`medium`,busy:s.saving,initialFocusRef:s.firstFieldRef,onCancel:()=>{s.saving||a()},closeLabel:l?`Cancel editing the feed`:t?`Cancel duplicating the feed`:`Cancel adding a feed`,actions:(0,Q.jsxs)(Q.Fragment,{children:[i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(g,{tone:`danger`,disabled:s.saving,onClick:i,children:`Remove feed`}),(0,Q.jsx)(h,{})]}),(0,Q.jsx)(g,{disabled:s.saving,onClick:a,children:`Cancel`}),o&&s.emailSource&&(0,Q.jsx)(g,{disabled:s.saving,onClick:()=>f(s.emailSource),children:`Test source`}),(0,Q.jsx)(g,{primary:!0,type:`submit`,form:c,disabled:s.saving,children:s.saving?`Checking the feed…`:l?`Save`:`Add feed`})]}),children:(0,Q.jsx)(`form`,{id:c,className:`rss-feed-form`,noValidate:!0,"aria-busy":s.saving,onSubmit:e=>void s.submit(e),children:s.fields})}),u&&o&&(0,Q.jsx)(zn,{source:u,onPreview:o,onClose:()=>f(void 0)})]})}function Jn({vaultId:e,state:t,feeds:n,onClose:r,onAdded:i,onRemove:a}){let o=(0,Z.useCallback)(t=>Qt(e,t),[e]),s=e=>e?n.feeds?.find(t=>t.id===e):void 0;if(t?.mode===`add`){let e=s(t.copyOf);return(0,Q.jsx)(qn,{copyOf:e,onPreview:o,onCancel:r,onSubmit:({title:e,type:t,...r})=>n.add({...t===`imap`?{type:t,...r}:r,...e?{title:e}:{}}),onSaved:i},e?.id??`new`)}let c=t?.mode===`edit`?s(t.id):void 0;return c?(0,Q.jsx)(qn,{feed:c,onPreview:o,onCancel:r,onSaved:r,onSubmit:({title:e,type:t,...r})=>n.edit(c.id,{...r,title:e||null}),onRemove:()=>a(c)},c.id):null}var Yn=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,28H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28Zm-4,24v92H179.31a19.86,19.86,0,0,0-14.14,5.86L147,168H109L90.83,149.86A19.86,19.86,0,0,0,76.69,144H52V52ZM52,204V168H75l18.14,18.14A19.86,19.86,0,0,0,107.31,192h41.38a19.86,19.86,0,0,0,14.14-5.86L181,168h23v36Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M216,48V160H179.31a8,8,0,0,0-5.66,2.34l-19.31,19.32a8,8,0,0,1-5.66,2.34H107.31a8,8,0,0,1-5.66-2.34L82.34,162.34A8,8,0,0,0,76.68,160H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.68A15.89,15.89,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,176H48V168H76.69L96,187.32A15.89,15.89,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H208a2,2,0,0,1,2,2V154H179.31a13.94,13.94,0,0,0-9.9,4.1L150.1,177.41a2,2,0,0,1-1.41.59H107.31a2,2,0,0,1-1.41-.58L86.59,158.1a13.94,13.94,0,0,0-9.9-4.1H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V166H76.69a2,2,0,0,1,1.41.58L97.41,185.9a13.94,13.94,0,0,0,9.9,4.1h41.38a13.94,13.94,0,0,0,9.9-4.1l19.31-19.31a2,2,0,0,1,1.41-.59H210v42A2,2,0,0,1,208,210Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H208a4,4,0,0,1,4,4V156H179.31a12,12,0,0,0-8.48,3.51l-19.32,19.32a4,4,0,0,1-2.82,1.17H107.31a4,4,0,0,1-2.82-1.17L85.17,159.51A12,12,0,0,0,76.69,156H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V164H76.69a4,4,0,0,1,2.82,1.17l19.32,19.32a12,12,0,0,0,8.48,3.51h41.38a12,12,0,0,0,8.48-3.51l19.32-19.32a4,4,0,0,1,2.82-1.17H212v44A4,4,0,0,1,208,212Z`}))]]),Xn=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:Yn}));Xn.displayName=`TrayIcon`;function Zn({sources:e,views:t,tags:n,feeds:r,counts:i,unread:a,selected:o,active:s,fetching:u,actions:d,onAdd:p,onSelect:m,onOpenList:h}){let[g,_]=(0,Z.useState)(),[y,b]=ae(ze),[x,S]=ae(Ae),C=t??e.filter(e=>e.kind===`view`),w=n??e.filter(e=>e.kind===`tag`),E=r??e.filter(e=>e.kind===`feed`),D=(e,t)=>h&&(0,Q.jsx)(L,{variant:`ghost`,size:`small`,className:`rss-source-list-open`,"aria-label":`List ${t}`,title:`Show the list`,onClick:()=>h(e),children:(0,Q.jsx)(he,{weight:`bold`,"aria-hidden":`true`})}),O=(e,t)=>()=>{_(void 0),e(t)};if(!e.length&&!E.length)return(0,Q.jsx)(`nav`,{className:`rss-source-list`,"aria-label":`Sources and views`,children:(0,Q.jsx)(f,{status:`empty`,heading:`No feeds yet`,action:(0,Q.jsx)(T,{variant:`primary`,onClick:p,children:`Add feed`}),children:`Follow a feed by its address, or by its site’s.`})});let k=e=>e===`starred`?(0,Q.jsx)(Ze,{weight:`fill`}):e===`liked`?(0,Q.jsx)(un,{weight:`fill`}):(0,Q.jsx)(Xn,{});return(0,Q.jsxs)(`nav`,{className:`rss-source-list`,"aria-label":`Sources and views`,children:[(0,Q.jsx)(l,{"aria-label":`Views`,edgeToEdge:!0,trailingSeparator:!1,items:C.map(e=>({id:e.id,title:e.title,description:ut(i[e.id]??0,a?.[e.id],!ct(e.id)),leading:(0,Q.jsx)(`span`,{className:`rss-source-icon`,"aria-hidden":`true`,children:k(e.id)}),...h?{actions:D(e.id,e.title)}:{},selected:e.id===o,keyboardItem:s,ariaLabel:`Open ${e.title}`})),onSelect:m}),(0,Q.jsxs)(`section`,{className:`rss-source-section`,"aria-label":`Tag views`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`rss-section-header`,onClick:()=>b(!y),"aria-expanded":!y,"aria-label":`Toggle tags list, ${w.length} tags`,children:[(0,Q.jsx)(`span`,{className:`rss-section-caret`,"aria-hidden":`true`,children:y?(0,Q.jsx)(he,{weight:`bold`}):(0,Q.jsx)(q,{weight:`bold`})}),(0,Q.jsx)(`span`,{className:`rss-section-title`,children:`Tags`}),(0,Q.jsx)(`span`,{className:`rss-section-count`,children:w.length})]}),!y&&(w.length>0?(0,Q.jsx)(l,{"aria-label":`Tags`,edgeToEdge:!0,trailingSeparator:!1,items:w.map(e=>({id:e.id,title:`#${e.title}`,description:ut(i[e.id]??0,a?.[e.id]),leading:(0,Q.jsx)(`span`,{className:`rss-source-icon`,"aria-hidden":`true`,children:(0,Q.jsx)(on,{})}),...h?{actions:D(e.id,`#${e.title}`)}:{},selected:e.id===o,keyboardItem:s,ariaLabel:`Open #${e.title} tag`})),onSelect:m}):(0,Q.jsx)(`div`,{className:`rss-source-empty-hint`,children:`No tags yet`}))]}),(0,Q.jsxs)(`section`,{className:`rss-source-section`,"aria-label":`Feeds`,children:[(0,Q.jsxs)(`div`,{className:`rss-section-header-row`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`rss-section-header`,onClick:()=>S(!x),"aria-expanded":!x,"aria-label":`Toggle feeds, ${E.length} feeds`,children:[(0,Q.jsx)(`span`,{className:`rss-section-caret`,"aria-hidden":`true`,children:x?(0,Q.jsx)(he,{weight:`bold`}):(0,Q.jsx)(q,{weight:`bold`})}),(0,Q.jsx)(`span`,{className:`rss-section-title`,children:`Feeds`}),(0,Q.jsx)(`span`,{className:`rss-section-count`,children:E.length})]}),(0,Q.jsx)(L,{variant:`ghost`,size:`small`,"aria-label":`Add feed`,title:`Add feed`,onClick:p,children:(0,Q.jsx)(X,{weight:`bold`,"aria-hidden":`true`})})]}),!x&&(E.length>0?(0,Q.jsx)(l,{"aria-label":`Feeds`,edgeToEdge:!0,trailingSeparator:!1,items:E.map(e=>({id:e.id,title:e.title,description:ut(i[e.id]??0,a?.[e.id],!ct(e.id)),leading:(0,Q.jsx)(`span`,{className:`rss-source-icon`,"aria-hidden":`true`,children:e.feedType===`imap`?(0,Q.jsx)(Pt,{}):(0,Q.jsx)(_e,{})}),actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(v,{open:g===e.id,onOpenChange:t=>_(t?e.id:void 0),label:`Actions for ${e.title}`,placement:`bottom-end`,trigger:(0,Q.jsx)(L,{variant:`ghost`,size:`small`,"aria-label":`Actions for ${e.title}`,title:`Feed actions`,children:(0,Q.jsx)(ye,{weight:`bold`,"aria-hidden":`true`})}),children:[(0,Q.jsx)(c,{onClick:O(d.edit,e.id),children:`Edit feed…`}),(0,Q.jsx)(c,{onClick:O(d.duplicate,e.id),children:`Duplicate feed…`}),(0,Q.jsx)(c,{disabled:u,onClick:O(d.fetch,e.id),children:`Fetch updates`}),(0,Q.jsx)(j,{}),(0,Q.jsx)(c,{className:`danger`,onClick:O(d.remove,e.id),children:`Remove feed…`})]}),D(e.id,e.title)]}),selected:e.id===o,keyboardItem:s,ariaLabel:`Open ${e.title}`})),onSelect:m}):(0,Q.jsx)(`div`,{className:`rss-source-empty-hint`,children:(0,Q.jsx)(T,{variant:`ghost`,size:`small`,onClick:p,children:`Add feed`})}))]})]})}function Qn(e){let t=new Set,n=[];for(let r of e)for(let e of r.entries){let r=`${e.feedId}\n${e.id}`;t.has(r)||(t.add(r),n.push(e))}return n}function $n(e){return!!(e&&typeof e==`object`&&Array.isArray(e.pages))}var er=e=>!e.custom?.hidden,tr=e=>er(e)&&!e.custom?.readAt;function nr(e,t){if(!$n(e))return e;let n=e=>e.id===t.id&&e.feedId===t.feedId,r=e.pages.flatMap(e=>e.entries).find(n);if(!r)return e;let i=Number(er(t))-Number(er(r)),a=Number(tr(t))-Number(tr(r));return{...e,pages:e.pages.map(e=>({...e,entries:e.entries.map(e=>n(e)?t:e),total:e.total+i,unread:e.unread+a}))}}function rr(e){return[`rss-entries`,e]}var ir=(e,t)=>[...rr(e),t];function ar(e){return e===`all`?{inbox:!0,includeHidden:!0}:e===`starred`?{starred:!0,includeHidden:!0}:e===`liked`?{rating:`like`,includeHidden:!0}:e.startsWith(`tag:`)?{tag:e.slice(st.length),includeHidden:!0}:{feed:e,includeHidden:!0}}function or(e,t,n){let r=V,i=n&&!!t,a=(0,Z.useMemo)(()=>ir(e,t??``),[t,e]);ee(i?e:``,t=>{(t.type===`reset`||t.type===`changes`&&t.changes.some(e=>e.kind===`rss-entries`))&&r.invalidateQueries({queryKey:rr(e)})});let o=We({queryKey:a,initialPageParam:0,queryFn:async({pageParam:n})=>{let r=await Jt(e,{...ar(t??``),offset:n,limit:50});return{entries:r.entries.map(ht),total:r.total,unread:r.unread,...r.next===void 0?{}:{next:r.next}}},getNextPageParam:e=>e.next,enabled:i,refetchOnWindowFocus:!1},r),s=(0,Z.useMemo)(()=>o.data?Qn(o.data.pages):void 0,[o.data]),c=o.data?.pages[0],{hasNextPage:l,isFetchingNextPage:u,fetchNextPage:d}=o,f=(0,Z.useCallback)(()=>{l&&!u&&d()},[d,l,u]),p=(0,Z.useCallback)(async(t,n)=>{let i=ht(await Xt(e,t.feedId,t.id,n));return r.setQueriesData({queryKey:rr(e)},e=>nr(e,i)),r.invalidateQueries({queryKey:sr(e)}),i},[r,e]);return{entries:i?s:void 0,...i&&c?{total:c.total,unread:c.unread}:{},hasMore:i&&!!l,loadingMore:u,loadMore:f,...o.error?{error:o.error instanceof Error?o.error.message:String(o.error)}:{},update:p}}function sr(e){return[...rr(e),`@summary`]}function cr(e,t){return Ve({queryKey:sr(e),queryFn:()=>Yt(e),enabled:t,refetchOnWindowFocus:!1},V).data}var lr=5;function ur(e,t,n){let{hasMore:r,loadMore:i}=n;(0,Z.useEffect)(()=>{if(!e||!r||!t)return;let n=t.findIndex(t=>t.id===e.id);n>=0&&t.length-n<=lr&&i()},[e,t,r,i])}function dr(e,t){let n=(0,Z.useRef)(void 0),r=(0,Z.useRef)(void 0),i=(0,Z.useRef)({entry:e,update:t});i.current={entry:e,update:t};let a=(0,Z.useCallback)(e=>{n.current=e.id,e.custom?.readAt||i.current.update(e,{read:!0}).catch(()=>{n.current===e.id&&(n.current=void 0)})},[]);return(0,Z.useEffect)(()=>{e?n.current!==e.id&&r.current!==e.id&&a(e):n.current=void 0},[e,a]),(0,Z.useMemo)(()=>({openingOnItsOwn(e){r.current=e},openingByChoice(e){let t=i.current.entry;t?.id===e&&r.current===e&&a(t),r.current=void 0},engage(){let e=i.current.entry;e&&r.current===e.id&&(r.current=void 0,a(e))},withRead(e,t){return r.current===e.id?(r.current=void 0,n.current=e.id,t.read!==void 0||e.custom?.readAt?t:{...t,read:!0}):t}}),[a])}function fr(e,t,n,r,i){let a=(0,Z.useRef)({entries:[]});return(0,Z.useMemo)(()=>{if(!e||!t){a.current={entries:[]};return}let o=a.current,s=`${JSON.stringify(r)}:${i?.distinguishRead??!0}`;if(o.sourceId!==n||o.filterKey!==s||!o.entries.length){let a=Oe(e,r,t.id,void 0,i).map(e=>e.entry);return a.some(e=>e.id===t.id)||a.push(t),o.sourceId=n,o.filterKey=s,o.entries=a,a}let c=new Map(e.map(e=>[e.id,e])),l=o.entries.map(e=>c.get(e.id)??e);if(!l.some(e=>e.id===t.id)){let n=c.get(t.id)??t,r=e.findIndex(e=>e.id===t.id);if(r>=0){let t=!1;for(let i=0;i<l.length;i++)if(e.findIndex(e=>e.id===l[i].id)>r){l.splice(i,0,n),t=!0;break}t||l.push(n)}else l.push(n)}let u=l.at(-1),d=u?e.findIndex(e=>e.id===u.id):-1;if(d>=0&&d<e.length-1){let n=new Set(l.map(e=>e.id)),a=Oe(e.slice(d+1),r,t.id,void 0,i).map(e=>e.entry).filter(e=>!n.has(e.id));l.push(...a)}return o.entries=l,l},[e,t?.id,n,r])}function pr(e){return[`rss-feeds`,e]}function mr(e,t){let n=V,r=(0,Z.useMemo)(()=>pr(e),[e]);ee(t?e:``,e=>{(e.type===`reset`||e.type===`changes`&&e.changes.some(e=>e.kind===`rss`||e.kind===`rss-entries`))&&n.invalidateQueries({queryKey:r})});let i=Ve({queryKey:r,queryFn:()=>Ht(e),enabled:t,refetchOnWindowFocus:!1},n),a=(0,Z.useCallback)(()=>Promise.all([n.invalidateQueries({queryKey:r}),n.invalidateQueries({queryKey:rr(e)})]),[n,r,e]),o=(0,Z.useCallback)(async t=>{let i=await Ut(e,t);return n.setQueryData(r,e=>[...(e??[]).filter(e=>e.id!==i.id),i]),a(),i},[n,r,a,e]),s=(0,Z.useCallback)(async(t,i)=>{let o=await Wt(e,t,i);return n.setQueryData(r,e=>(e??[]).map(e=>e.id===t?o:e)),a(),o},[n,r,a,e]),c=(0,Z.useCallback)(async t=>{await Gt(e,t),n.setQueryData(r,e=>(e??[]).filter(e=>e.id!==t)),a()},[n,r,a,e]),l=(0,Z.useCallback)(async t=>{let n=await Kt(e,t);return await a(),n},[a,e]),u=(0,Z.useCallback)(async()=>{let t=await qt(e);return await a(),t},[a,e]);return{feeds:i.data,...i.error?{error:i.error instanceof Error?i.error.message:String(i.error)}:{},add:o,edit:s,remove:c,fetch:l,fetchAll:u}}function hr(e,t){if(!e||!t)return{};let n=e.findIndex(e=>e.id===t);return n<0?{}:{previous:e[n-1],next:e[n+1]}}function gr(e,t){let n=e.findIndex(e=>e.id===t),r=e=>e.id!==t&&e.custom?.hidden!==!0;return e.slice(n+1).find(r)??e.slice(0,Math.max(n,0)).reverse().find(r)}function _r(e,t,n,r){let i=(0,Z.useRef)(void 0),a=(0,Z.useRef)(r);a.current=r,(0,Z.useEffect)(()=>{let r=!!t&&i.current===t;i.current=n?t:void 0,e&&!n&&r&&a.current()},[e,n,t])}function vr({following:e,feed:t,entry:n,hasNext:r,hasPrevious:i},a){return[{id:`rss.add-feed`,label:`Add RSS feed`,detail:`Follow a feed by its address or its site’s`,aliases:[`follow feed`,`subscribe`],run:()=>a().startAdding()},{id:`rss.preference-profiles`,label:`RSS preference profiles`,detail:`Read, activate or generate the profiles distilled from your likes and dislikes`,aliases:[`generate profile`,`news profile`,`preferences`],run:()=>a().openProfiles()},...e?[{id:`rss.fetch-all`,label:`Fetch all RSS feeds`,detail:`Fetch every feed now`,aliases:[`refresh feeds`,`update feeds`],run:()=>void a().runFetch(`all`)}]:[],...t?[{id:`rss.fetch-feed`,label:`Fetch RSS feed updates`,detail:`Fetch ${t.name} now`,aliases:[`refresh feed`],run:()=>void a().runFetch(t.id)},{id:`rss.edit-feed`,label:`Edit RSS feed`,detail:`Change the address, title or settings of ${t.name}`,aliases:[`rename feed`,`feed settings`],run:()=>a().startEditing(t.id)},{id:`rss.duplicate-feed`,label:`Duplicate RSS feed`,detail:`Add a new feed starting from ${t.name}'s settings`,aliases:[`copy feed`,`clone feed`],run:()=>a().startDuplicating(t.id)},{id:`rss.remove-feed`,label:`Remove RSS feed`,detail:`Stop following ${t.name}`,aliases:[`unsubscribe`,`delete feed`],run:()=>a().askRemove(t)}]:[],...n?[...r?[{id:`rss.next-entry`,label:`Next RSS entry`,detail:`Read the entry below this one`,aliases:[`next article`],run:()=>a().step(1)}]:[],...i?[{id:`rss.previous-entry`,label:`Previous RSS entry`,detail:`Read the entry above this one`,aliases:[`previous article`],run:()=>a().step(-1)}]:[],{id:`rss.like-entry`,label:`Like entry`,detail:n.title,run:()=>void a().feedback(n,{rating:{value:`like`}}).catch(()=>void 0)},{id:`rss.dislike-entry`,label:`Dislike entry`,detail:n.title,run:()=>void a().feedback(n,{rating:{value:`dislike`}}).catch(()=>void 0)},...n.link?[{id:`rss.open-original`,label:`Open the original`,detail:n.title,keys:`Space`,aliases:[`open article`,`open in browser`],run:()=>void _t(n)}]:[],{id:`rss.star-entry`,label:n.custom?.starred?`Unstar entry`:`Star entry`,detail:n.title,run:()=>void a().feedback(n,{starred:!n.custom?.starred}).catch(()=>void 0)},n.custom?.hidden?{id:`rss.unhide-entry`,label:`Unhide entry`,detail:`Show it in its feed and views again`,run:()=>void a().hide(n,!1)}:{id:`rss.hide-entry`,label:`Hide entry`,detail:`Leave it out of every feed and view`,run:()=>void a().hide(n)}]:[]]}var yr={starred:`Starred`,liked:`Liked`,disliked:`Disliked`,read:`Read`,hidden:`Hidden`,notes:`With notes`},br=[{value:`list`,label:`List`},{value:`grid`,label:`Grid`}],xr=`all`;function Sr({feed:e,title:t,display:n,filter:r,fetching:i,isTag:a,hasReadStatus:o=!0,onFilter:l,onLayout:u,onFetch:d,onEdit:f,onRemove:p,inboxFeeds:m,onInboxFeed:h}){let g=e=>l({...r,...e});return(0,Q.jsx)(Ft,{label:`Options for ${t}`,active:!ke(r),children:l=>{let _=e=>()=>{l(),e()};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(c,{disabled:i,onClick:_(d),children:[(0,Q.jsx)(Ge,{"aria-hidden":`true`}),i?`Fetching…`:e?`Fetch updates`:`Fetch all feeds`]}),e&&(0,Q.jsxs)(c,{onClick:_(f),children:[(0,Q.jsx)(me,{"aria-hidden":`true`}),`Edit feed…`]}),e&&(0,Q.jsxs)(c,{className:`danger`,onClick:_(p),children:[(0,Q.jsx)(Ke,{"aria-hidden":`true`}),`Remove feed…`]}),(0,Q.jsx)(j,{}),n&&(0,Q.jsx)(s,{choice:{label:`Show ${t} as`,icon:n.layout===`grid`?(0,Q.jsx)(xe,{}):(0,Q.jsx)(be,{}),value:n.layout,groups:[{options:br}],onChange:u}}),a?(0,Q.jsx)(s,{choice:{label:`Read status`,value:r.tagRead??`fade`,groups:[{options:[{value:`fade`,label:`Dim out read`},{value:`hide`,label:`Hide read items`},{value:`ignore`,label:`Ignore read items`}]}],onChange:e=>g({tagRead:e})}}):o&&(0,Q.jsx)(s,{choice:{label:`Read status`,value:r.read,groups:[{options:[{value:`hide`,label:`Hide read items`},{value:`fade`,label:`Fade out read`}]}],onChange:e=>g({read:e})}}),(0,Q.jsx)(s,{choice:{label:`Show only`,value:r.only??xr,groups:[{options:[{value:xr,label:`Everything`}]},{options:Me.map(e=>({value:e,label:yr[e]}))}],onChange:e=>g({only:e===xr?void 0:e})}}),m&&m.length>0&&h&&(0,Q.jsxs)(te,{menuLabel:`Feeds in the Inbox`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_e,{"aria-hidden":`true`}),` Feeds in the Inbox`]}),children:[(0,Q.jsx)(re,{children:`A new feed shows here until you switch it off.`}),m.map(e=>(0,Q.jsxs)(c,{role:`menuitemcheckbox`,"aria-checked":e.included,className:`select-menu-option`,onClick:()=>h(e.id,!e.included),children:[(0,Q.jsx)(`span`,{className:`select-menu-option-label`,children:e.name}),e.included&&(0,Q.jsx)(ge,{className:`select-menu-check`,"aria-hidden":`true`,weight:`bold`})]},e.id))]})]})}})}function Cr({following:e,fetching:t,onFetchAll:n,onAdd:r,onProfiles:i}){return(0,Q.jsx)(Ft,{label:`RSS options`,children:a=>{let o=e=>()=>{a(),e()};return(0,Q.jsxs)(Q.Fragment,{children:[e&&(0,Q.jsxs)(c,{disabled:!!t,onClick:o(n),children:[(0,Q.jsx)(Ge,{"aria-hidden":`true`}),t===`all`?`Fetching…`:`Fetch all feeds`]}),(0,Q.jsxs)(c,{onClick:o(r),children:[(0,Q.jsx)(X,{"aria-hidden":`true`}),`Add feed…`]}),(0,Q.jsx)(j,{}),(0,Q.jsxs)(c,{onClick:o(i),children:[(0,Q.jsx)(qe,{"aria-hidden":`true`}),`Preference profiles…`]})]})}})}var wr={Accept:`application/json`},Tr={...wr,"Content-Type":`application/json`};function Er(e,t=fetch){return U(W(e,`rss/feedback`),t,{headers:wr})}function Dr(e,t=fetch){return U(W(e,`rss/profiles`),t,{headers:wr})}function Or(e,t,n=fetch){return U(W(e,`rss/profiles/${encodeURIComponent(t)}`),n,{headers:wr})}function kr(e,t,n,r=fetch){return U(W(e,`rss/profiles/${encodeURIComponent(t)}/test`),r,{method:`POST`,headers:Tr,body:JSON.stringify(n?{model:n}:{})})}async function Ar(e,t,n=fetch){await U(W(e,`rss/profiles/${encodeURIComponent(t)}`),n,{method:`DELETE`,headers:wr})}function jr(e,t,n=fetch){return U(W(e,`rss/profiles/active`),n,{method:`PUT`,headers:Tr,body:JSON.stringify({id:t})})}function Mr(e,t,n=fetch){return U(W(e,`rss/profiles`),n,{method:`POST`,headers:Tr,body:JSON.stringify(t)})}var Nr=`latest:50`,Pr=[{label:`Most recently rated`,options:[25,50,100,200].map(e=>({value:`latest:${e}`,label:`Latest ${e}`}))},{label:`Random sample`,options:[25,55,100].map(e=>({value:`random:${e}`,label:`${e} at random`}))},{options:[{value:`latest:all`,label:`Every rated entry`}]}];function Fr(e){let[t,n]=e.split(`:`);return{mode:t===`random`?`random`:`latest`,...n&&n!==`all`?{count:Number(n)}:{}}}function Ir(e,t){return e.count===void 0?t:Math.min(e.count,t)}function Lr(e){let t=e.createdAt??e.id.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/,`$1-$2-$3T$4:$5:$6Z`),n=new Date(t);if(Number.isNaN(n.getTime()))return e.id;let r=e=>String(e).padStart(2,`0`);return`${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())} ${r(n.getHours())}:${r(n.getMinutes())}`}function Rr(e){return e.toFixed(2)}function zr(e){return e>=.85?`strong`:e>=.7?`good`:e>=.6?`weak`:`no better than chance`}var Br=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z`}))]]),Vr=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:Br}));Vr.displayName=`CircleIcon`;function Hr({profiles:e,active:t,selected:n,onSelect:r,onActivate:i,onDelete:a}){let o=e.map(e=>{let r=Lr(e),o=e.id===t;return{id:e.id,title:r,subtitle:[o?`Active`:void 0,e.score===void 0?void 0:`Score ${Rr(e.score)}`].filter(Boolean).join(` · `)||void 0,description:e.error?(0,Q.jsx)(I,{as:`span`,size:`caption`,tone:`danger`,children:e.error}):`${e.modelId??`Unknown model`}${e.basedOn?` · ${e.basedOn}`:``}`,ariaLabel:`Open the profile of ${r}`,selected:e.id===n,keyboardItem:!0,className:o?`rss-profile-row is-active`:`rss-profile-row`,actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(L,{size:`small`,variant:`ghost`,"aria-pressed":o,"aria-label":o?`Stop using the profile of ${r}`:`Make the profile of ${r} active`,title:o?`Active profile: click to use none`:`Make active`,disabled:!!e.error&&!o,onClick:()=>i(o?null:e.id),children:o?(0,Q.jsx)(ve,{weight:`fill`,"aria-hidden":`true`}):(0,Q.jsx)(Vr,{"aria-hidden":`true`})}),(0,Q.jsx)(L,{size:`small`,variant:`ghost`,"aria-label":`Delete the profile of ${r}`,title:`Delete profile`,onClick:()=>a(e),children:(0,Q.jsx)(Ke,{"aria-hidden":`true`})})]})}});return(0,Q.jsx)(l,{className:`rss-profile-list`,"aria-label":`Preference profiles`,trailingSeparator:!1,items:o,onSelect:r,emptyState:(0,Q.jsx)(f,{status:`empty`,density:`inline`,children:`No profile yet. Generate one from the entries you liked and disliked.`})})}var Ur=e=>`${e.feedId}/${e.entryId}`,Wr=(e,t)=>t?`${e} ${Rr(t.score)} on ${t.count}`:void 0;function Gr(e){let t=e.tags.map(e=>`#${e}`).join(` `),n=e.suggested.map(({tag:e})=>`#${e}`).join(` `),r=e.tags.length||e.suggested.length?`Tags: yours ${t||`none`}, judge ${n||`none`}`:void 0;return[`${e.feedName}${e.seen?` · learned from`:` · not seen`}`,r].filter(Boolean).join(` · `)}function Kr({test:e,onOpen:t}){let n=new Map(e.rows.map(e=>[Ur(e),e])),r=e.evaluator.kind===`jev`?`Jev (${e.evaluator.modelId})`:e.evaluator.modelId,i=e.like?e.basis===`unseen`?`on the ${K(e.like.count,`rated entry`,`rated entries`)} the profile had not learned from`:`on all ${K(e.like.count,`rated entry`,`rated entries`)}, most of which the profile learned from, so the score flatters it`:`on tags alone`;return(0,Q.jsxs)(`div`,{className:`rss-profile-test`,children:[(0,Q.jsxs)(`div`,{className:`rss-profile-test-score`,role:`status`,children:[(0,Q.jsx)(F,{as:`h3`,size:`page`,className:`rss-profile-test-number`,children:Rr(e.score)}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(I,{as:`p`,weight:`semibold`,children:`A ${zr(e.score)} profile, ${i}.`}),(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:[Wr(`Like`,e.like),Wr(`not seen`,e.like?.unseen),Wr(`learned from`,e.like?.seen),Wr(`Tags`,e.tags)].filter(Boolean).join(` · `)}),(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:`0.5 is a judge that knows nothing, 1 one that answers as you did. Judged by ${r}.`}),e.evaluator.note&&(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`warning`,children:e.evaluator.note})]})]}),(0,Q.jsx)(l,{"aria-label":`Judged entries`,trailingSeparator:!1,className:`rss-profile-test-rows`,onSelect:e=>{let r=n.get(e);r&&t(r)},items:e.rows.map(e=>({id:Ur(e),title:e.title,subtitle:Gr(e),ariaLabel:`Open ${e.title} in the reader`,keyboardItem:!0,className:e.error!==void 0&&e.error>=.5?`is-miss`:void 0,leading:e.rating===`like`?(0,Q.jsx)(un,{}):e.rating===`dislike`?(0,Q.jsx)(cn,{}):void 0,actions:(0,Q.jsx)(I,{as:`span`,size:`small`,monospace:!0,className:`rss-profile-test-like`,title:e.rating?`You ${e.rating}d it; the judge says ${Rr(e.like)}`:`Not rated; judged for its tags`,children:Rr(e.like)})}))})]})}var qr=[Je.readOnly.of(!0)],Jr=[{value:`profile`,label:`Profile`},{value:`test`,label:`Test`}],Yr={providerId:``,modelId:``};function Xr(e){let[t,n,r]=e.split(`
|
|
2
|
+
`);return t&&n?{providerId:t,modelId:n,...r?{reasoningEffort:r}:{}}:void 0}function Zr({vaultId:e,profile:t,active:n,settings:r,onTested:i,onOpenEntry:a}){let{providers:o}=b(),[s,c]=(0,Z.useState)(),[l,u]=(0,Z.useState)(`profile`),[d,p]=(0,Z.useState)(),[m,h]=(0,Z.useState)(!1),[g,v]=(0,Z.useState)();(0,Z.useEffect)(()=>{let n=!0;return v(void 0),Or(e,t.id).then(({source:e,test:r})=>{n&&c({id:t.id,source:e,...r?{test:r}:{}})},e=>{n&&c({id:t.id,error:G(e)})}),()=>{n=!1}},[e,t.id]);let y=s?.id===t.id?s:void 0,x=_({providers:o,selection:d??r?.evaluatorModel??r?.model??Yr,disabled:m,onChange:p}),S=Xr(x.value),w=r?.jev===!0,E=async()=>{h(!0),v(void 0),u(`test`);try{let n=await kr(e,t.id,w?void 0:S);c(e=>e?.id===t.id?{...e,test:n}:e),i()}catch(e){v(G(e))}finally{h(!1)}};return(0,Q.jsxs)(`section`,{className:`rss-profile-pane`,"aria-label":`Profile of ${Lr(t)}`,children:[(0,Q.jsx)(`header`,{className:`rss-profile-pane-header`,children:(0,Q.jsxs)(I,{as:`p`,size:`small`,tone:`muted`,monospace:!0,children:[`.brian/rss/profiles/`,t.id,`.yaml`,n?` · active`:``]})}),(0,Q.jsx)(C,{label:`Profile sections`,options:Jr,value:l,onChange:u,action:(0,Q.jsxs)(`div`,{className:`rss-profile-test-controls`,children:[w?(0,Q.jsx)(I,{as:`span`,size:`small`,tone:`muted`,children:`Judged by Jev`}):(0,Q.jsx)(R,{...x,label:`Judge`,placement:`bottom-end`,className:`model-select`}),(0,Q.jsx)(T,{variant:`primary`,size:`small`,disabled:m||!y||y.error!==void 0||!w&&!S,"aria-busy":m,onClick:()=>void E(),children:m?`Testing…`:`Test profile`})]}),children:y?y.error===void 0?l===`profile`?(0,Q.jsx)(`div`,{className:`rss-profile-source`,children:(0,Q.jsx)(Ye,{documentId:`rss-profile-${t.id}`,path:`${t.id}.yaml`,label:`Profile ${t.id}.yaml`,value:y.source??``,onChange:()=>void 0,extensions:qr,wrap:!0})}):(0,Q.jsxs)(Q.Fragment,{children:[g&&(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:g}),m?(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`${w?`Jev`:S?.modelId??`The model`} is judging the entries you rated and tagged. This can take a minute.`}):y.test?(0,Q.jsx)(Kr,{test:y.test,onOpen:a}):(0,Q.jsx)(f,{status:`empty`,density:`inline`,children:w?`Not tested yet. Test profile asks Jev how likely you are to like each entry you rated, and which tags it takes, then scores how close it came.`:`Not tested yet. Jev is not connected, so the chosen chat model judges: how likely you are to like each entry you rated, and which tags it takes.`})]}):(0,Q.jsx)(f,{status:`error`,density:`inline`,children:y.error}):(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`Reading the profile…`})})]})}var Qr=new Map([[`bold`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M240.49,175.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L203,196h-2.09a76.17,76.17,0,0,1-61.85-31.83L97.38,105.78A52.1,52.1,0,0,0,55.06,84H32a12,12,0,0,1,0-24H55.06a76.17,76.17,0,0,1,61.85,31.83l41.71,58.39A52.1,52.1,0,0,0,200.94,172H203l-3.52-3.51a12,12,0,0,1,17-17Zm-95.62-72.62a12,12,0,0,0,16.93-1.13A52,52,0,0,1,200.94,84H203l-3.52,3.51a12,12,0,0,0,17,17l24-24a12,12,0,0,0,0-17l-24-24a12,12,0,0,0-17,17L203,60h-2.09a76,76,0,0,0-57.2,26A12,12,0,0,0,144.87,102.89Zm-33.74,50.22a12,12,0,0,0-16.93,1.13A52,52,0,0,1,55.06,172H32a12,12,0,0,0,0,24H55.06a76,76,0,0,0,57.2-26A12,12,0,0,0,111.13,153.11Z`}))],[`duotone`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M107.14,98.8,128,128l-20.86,29.2A64,64,0,0,1,55.06,184H32V72H55.06A64,64,0,0,1,107.14,98.8ZM200.94,72a64,64,0,0,0-52.08,26.8L128,128l20.86,29.2A64,64,0,0,0,200.94,184H232V72Z`,opacity:`0.2`}),Z.createElement(`path`,{d:`M237.66,178.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L212.69,192H200.94a72.12,72.12,0,0,1-58.59-30.15l-41.72-58.4A56.1,56.1,0,0,0,55.06,80H32a8,8,0,0,1,0-16H55.06a72.12,72.12,0,0,1,58.59,30.15l41.72,58.4A56.1,56.1,0,0,0,200.94,176h11.75l-10.35-10.34a8,8,0,0,1,11.32-11.32ZM143,107a8,8,0,0,0,11.16-1.86l1.2-1.67A56.1,56.1,0,0,1,200.94,80h11.75L202.34,90.34a8,8,0,0,0,11.32,11.32l24-24a8,8,0,0,0,0-11.32l-24-24a8,8,0,0,0-11.32,11.32L212.69,64H200.94a72.12,72.12,0,0,0-58.59,30.15l-1.2,1.67A8,8,0,0,0,143,107Zm-30,42a8,8,0,0,0-11.16,1.86l-1.2,1.67A56.1,56.1,0,0,1,55.06,176H32a8,8,0,0,0,0,16H55.06a72.12,72.12,0,0,0,58.59-30.15l1.2-1.67A8,8,0,0,0,113,149Z`}))],[`fill`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237.66,178.34a8,8,0,0,1,0,11.32l-24,24A8,8,0,0,1,200,208V192a72.15,72.15,0,0,1-57.65-30.14l-41.72-58.4A56.1,56.1,0,0,0,55.06,80H32a8,8,0,0,1,0-16H55.06a72.12,72.12,0,0,1,58.59,30.15l41.72,58.4A56.08,56.08,0,0,0,200,176V160a8,8,0,0,1,13.66-5.66ZM143,107a8,8,0,0,0,11.16-1.86l1.2-1.67A56.08,56.08,0,0,1,200,80V96a8,8,0,0,0,13.66,5.66l24-24a8,8,0,0,0,0-11.32l-24-24A8,8,0,0,0,200,48V64a72.15,72.15,0,0,0-57.65,30.14l-1.2,1.67A8,8,0,0,0,143,107Zm-30,42a8,8,0,0,0-11.16,1.86l-1.2,1.67A56.1,56.1,0,0,1,55.06,176H32a8,8,0,0,0,0,16H55.06a72.12,72.12,0,0,0,58.59-30.15l1.2-1.67A8,8,0,0,0,113,149Z`}))],[`light`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M236.24,179.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L217.52,190H200.94a70.16,70.16,0,0,1-57-29.31l-41.71-58.4A58.11,58.11,0,0,0,55.06,78H32a6,6,0,0,1,0-12H55.06a70.16,70.16,0,0,1,57,29.31l41.71,58.4A58.11,58.11,0,0,0,200.94,178h16.58l-13.76-13.76a6,6,0,0,1,8.48-8.48Zm-92.06-74.41a5.91,5.91,0,0,0,3.48,1.12,6,6,0,0,0,4.89-2.51l1.19-1.67A58.11,58.11,0,0,1,200.94,78h16.58L203.76,91.76a6,6,0,1,0,8.48,8.48l24-24a6,6,0,0,0,0-8.48l-24-24a6,6,0,0,0-8.48,8.48L217.52,66H200.94a70.16,70.16,0,0,0-57,29.31L142.78,97A6,6,0,0,0,144.18,105.35Zm-32.36,45.3a6,6,0,0,0-8.37,1.39l-1.19,1.67A58.11,58.11,0,0,1,55.06,178H32a6,6,0,0,0,0,12H55.06a70.16,70.16,0,0,0,57-29.31l1.19-1.67A6,6,0,0,0,111.82,150.65Z`}))],[`regular`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M237.66,178.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L212.69,192H200.94a72.12,72.12,0,0,1-58.59-30.15l-41.72-58.4A56.1,56.1,0,0,0,55.06,80H32a8,8,0,0,1,0-16H55.06a72.12,72.12,0,0,1,58.59,30.15l41.72,58.4A56.1,56.1,0,0,0,200.94,176h11.75l-10.35-10.34a8,8,0,0,1,11.32-11.32ZM143,107a8,8,0,0,0,11.16-1.86l1.2-1.67A56.1,56.1,0,0,1,200.94,80h11.75L202.34,90.34a8,8,0,0,0,11.32,11.32l24-24a8,8,0,0,0,0-11.32l-24-24a8,8,0,0,0-11.32,11.32L212.69,64H200.94a72.12,72.12,0,0,0-58.59,30.15l-1.2,1.67A8,8,0,0,0,143,107Zm-30,42a8,8,0,0,0-11.16,1.86l-1.2,1.67A56.1,56.1,0,0,1,55.06,176H32a8,8,0,0,0,0,16H55.06a72.12,72.12,0,0,0,58.59-30.15l1.2-1.67A8,8,0,0,0,113,149Z`}))],[`thin`,Z.createElement(Z.Fragment,null,Z.createElement(`path`,{d:`M234.83,181.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L222.34,188h-21.4a68.15,68.15,0,0,1-55.34-28.48l-41.71-58.39A60.11,60.11,0,0,0,55.06,76H32a4,4,0,0,1,0-8H55.06A68.15,68.15,0,0,1,110.4,96.48l41.71,58.39A60.11,60.11,0,0,0,200.94,180h21.4l-17.17-17.17a4,4,0,0,1,5.66-5.66Zm-89.49-77.44a4,4,0,0,0,5.58-.93l1.19-1.67A60.11,60.11,0,0,1,200.94,76h21.4L205.17,93.17a4,4,0,0,0,5.66,5.66l24-24a4,4,0,0,0,0-5.66l-24-24a4,4,0,0,0-5.66,5.66L222.34,68h-21.4A68.15,68.15,0,0,0,145.6,96.48l-1.19,1.67A4,4,0,0,0,145.34,103.73Zm-34.68,48.54a4,4,0,0,0-5.58.93l-1.19,1.67A60.11,60.11,0,0,1,55.06,180H32a4,4,0,0,0,0,8H55.06a68.15,68.15,0,0,0,55.34-28.48l1.19-1.67A4,4,0,0,0,110.66,152.27Z`}))]]),$r=Z.forwardRef((e,t)=>Z.createElement(J,{ref:t,...e,weights:Qr}));$r.displayName=`ShuffleIcon`;var ei=e=>`${e.feedId}/${e.entryId}`,ti=[{rating:`like`,label:`Liked`,Icon:un},{rating:`dislike`,label:`Disliked`,Icon:cn}];function ni({items:e,included:t,onOpen:n}){let r=new Map(e.map(e=>[ei(e),e]));return(0,Q.jsx)(`div`,{className:`rss-profile-feedback`,children:ti.map(({rating:i,label:a,Icon:o})=>{let s=e.filter(e=>e.rating===i);return(0,Q.jsxs)(`section`,{className:`rss-profile-feedback-group is-${i}`,children:[(0,Q.jsxs)(F,{as:`h3`,size:`subsection`,className:`rss-profile-feedback-heading`,children:[(0,Q.jsx)(o,{"aria-hidden":`true`}),` `,a,` `,(0,Q.jsx)(I,{as:`span`,size:`small`,tone:`muted`,children:K(s.length,`entry`,`entries`)})]}),(0,Q.jsx)(l,{"aria-label":`${a} entries`,trailingSeparator:!1,className:`rss-profile-feedback-list`,emptyState:(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:`None yet.`}),onSelect:e=>{let t=r.get(e);t&&n(t)},items:s.map(e=>{let n=t!==void 0&&!t.has(ei(e));return{id:ei(e),title:e.title,subtitle:`${e.feedName}${e.starred?` · starred`:``}${n?` · not in the sample`:``}`,description:e.reason??(0,Q.jsx)(I,{as:`span`,size:`caption`,tone:`muted`,children:`No reason given`}),ariaLabel:`Open ${e.title} in the reader`,keyboardItem:!0,className:n?`is-left-out`:void 0}})})]},i)})})}function ri({generation:e,onOpenEntry:t,onGenerate:n,onCancel:r}){let{feedback:i,modelChoice:a,sampleValue:o,setSampleValue:s,sample:c,sampleSize:l,generating:u,error:d,model:p,context:m,setContext:h}=e,g=i.tags??[],_=i.items;return(0,Q.jsxs)(`section`,{className:`rss-profile-pane rss-profile-wizard`,"aria-label":`Generate a new profile`,"aria-busy":u,children:[(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:`A chat model reads the entries you liked and disliked, with your reasons, and the entries you tagged, and distills what you want from the news, and what each tag means to you, into a profile. New entries are judged against it: how likely you are to like each one, and which tags it takes.`}),(0,Q.jsx)(M,{label:`About you`,optional:!0,description:`Your work, your stack, where you are: what decides relevance that your ratings cannot show. Kept for the next profile.`,children:(0,Q.jsx)(O,{rows:3,maxLength:2e3,value:m,disabled:u,placeholder:`I build developer tools with Claude Code on macOS, and I live in Sweden.`,onChange:e=>h(e.target.value)})}),(0,Q.jsxs)(`div`,{className:`rss-profile-wizard-choices`,children:[(0,Q.jsx)(R,{...a,placement:`bottom-start`,className:`model-select`}),(0,Q.jsx)(R,{label:`Entries`,icon:(0,Q.jsx)($r,{}),value:o,groups:Pr,disabled:u,placement:`bottom-start`,onChange:s}),(0,Q.jsx)(`span`,{className:`rss-profile-wizard-spacer`}),(0,Q.jsx)(T,{variant:`ghost`,size:`small`,disabled:u,onClick:r,children:`Cancel`}),(0,Q.jsx)(T,{variant:`primary`,size:`small`,disabled:!e.canGenerate,"aria-busy":u,onClick:n,children:u?`Generating…`:`Generate profile`})]}),!p&&(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`warning`,children:`Connect a chat model in Settings › AI Providers to generate a profile.`}),u&&(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`${p?.modelId??`The model`} is reading ${l} entries. This can take a minute or two.`}),d&&(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:d}),i.error?(0,Q.jsx)(f,{status:`error`,density:`inline`,children:i.error}):_?_.length===0?(0,Q.jsx)(f,{status:`empty`,density:`inline`,children:`Nothing rated yet. Like or dislike entries in the reader, with a reason where you can, then come back.`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:g.length?`It learns ${K(g.length,`tag`)}: ${g.map(({tag:e,count:t})=>`#${e} (${t})`).join(`, `)}.`:`No entry is tagged yet, so the profile will not suggest tags.`}),(0,Q.jsx)(I,{as:`p`,size:`small`,tone:`muted`,children:c.mode===`random`?`${l} of these ${_.length} rated entries will be drawn at random.`:`The model reads the ${l} most recently rated of these ${_.length} entries.`}),(0,Q.jsx)(ni,{items:_,...e.included?{included:e.included}:{},onOpen:t})]}):(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`Reading your feedback…`})]})}var ii={providerId:``,modelId:``};function ai(e){let[t,n,r]=e.split(`
|
|
3
|
+
`);return t&&n?{providerId:t,modelId:n,...r?{reasoningEffort:r}:{}}:void 0}function oi(e,t,n){let r=t?.model,{providers:i}=b(),[a,o]=(0,Z.useState)({}),[s,c]=(0,Z.useState)(),[l,u]=(0,Z.useState)(),[d,f]=(0,Z.useState)(Nr),[p,m]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)();(0,Z.useEffect)(()=>{if(!n)return;let t=!0;return Er(e).then(({entries:e,tags:n})=>{t&&o({items:e,tags:n})},e=>{t&&o({error:G(e)})}),()=>{t=!1}},[e,n]);let v=_({providers:i,selection:l??r??ii,disabled:p,onChange:u}),y=ai(v.value),x=Fr(d),S=a.items??[],C=s??t?.context??``,w=(0,Z.useMemo)(()=>x.mode===`latest`?new Set(S.slice(0,x.count??S.length).map(ei)):void 0,[S,x.mode,x.count]),T=async()=>{if(y&&!p){m(!0),g(void 0);try{return await Mr(e,{model:y,sample:x,context:C})}catch(e){g(G(e));return}finally{m(!1)}}};return{feedback:a,modelChoice:{...v,label:`Model`},model:y,context:C,setContext:c,sampleValue:d,setSampleValue:f,sample:x,included:w,generating:p,error:h,generate:T,sampleSize:Ir(x,S.length),canGenerate:!!y&&S.length>0&&!p}}function si({vaultId:e,onClose:t,onOpenEntry:n}){let r=m(),i=p(),a=ue(),[o,s]=(0,Z.useState)({}),[c,l]=(0,Z.useState)(),u=oi(e,o.value,c?.kind===`generate`),h=(0,Z.useCallback)(()=>Dr(e).then(e=>s({value:e}),e=>s({error:G(e)})),[e]);(0,Z.useEffect)(()=>{h()},[h]);let g=o.value?.profiles??[],_=c?.kind===`profile`?g.find(e=>e.id===c.id):void 0,v=e=>t=>r.error(`${e}: ${G(t)}`),b=t=>void jr(e,t).then(e=>{s({value:e}),r.success(t?`Profile made active.`:`No profile is active now.`)},v(`The active profile could not be changed`)),x=async t=>{await i.confirm({title:`Delete this profile?`,detail:`The profile of ${Lr(t)} is deleted from the vault${t.id===o.value?.active?`, and no profile stays active`:``}.`,confirmLabel:`Delete`,tone:`danger`})&&await Ar(e,t.id).then(async()=>{c?.kind===`profile`&&c.id===t.id&&l(void 0),await h(),r.success(`Profile deleted.`)},v(`The profile could not be deleted`))},S=async()=>{let e=await u.generate();e&&(await h(),l({kind:`profile`,id:e.id}),r.success(e.basedOn?`New profile distilled from ${e.basedOn}.`:`New profile distilled.`))},C=!a||!c,w=c?.kind===`generate`?(0,Q.jsx)(ri,{generation:u,onOpenEntry:n,onGenerate:()=>void S(),onCancel:()=>l(void 0)}):_?(0,Q.jsx)(Zr,{vaultId:e,profile:_,active:_.id===o.value?.active,settings:o.value,onTested:()=>void h(),onOpenEntry:n}):(0,Q.jsx)(f,{status:`empty`,density:`inline`,children:`Choose a profile to read it, or generate a new one.`});return(0,Q.jsx)(d,{title:`Preference profiles`,description:`What the reader learned from your likes and dislikes.`,size:`large`,scrollableBody:!0,busy:u.generating,className:`rss-profiles-popup${a?``:` is-split`}`,onCancel:t,children:(0,Q.jsxs)(`div`,{className:`rss-profiles-layout`,children:[C&&(0,Q.jsxs)(`div`,{className:`rss-profiles-list-column`,children:[(0,Q.jsxs)(T,{variant:c?.kind===`generate`?`secondary`:`primary`,size:`small`,className:`rss-profiles-new`,disabled:u.generating,"aria-pressed":c?.kind===`generate`,onClick:()=>l({kind:`generate`}),children:[(0,Q.jsx)(X,{"aria-hidden":`true`}),` New profile`]}),o.error?(0,Q.jsx)(f,{status:`error`,density:`inline`,children:o.error}):o.value?(0,Q.jsx)(Hr,{profiles:g,active:o.value.active,selected:c?.kind===`profile`?c.id:void 0,onSelect:e=>l({kind:`profile`,id:e}),onActivate:b,onDelete:e=>void x(e)}):(0,Q.jsx)(f,{status:`loading`,density:`inline`,children:`Reading the profiles…`})]}),(!a||c)&&(0,Q.jsxs)(`div`,{className:`rss-profiles-main`,children:[a&&(0,Q.jsx)(y,{label:`Back to the profiles`,onClick:()=>l(void 0)}),w]})]})})}function ci(e){let t=e.reduce((e,t)=>e+t.added,0),n=e.filter(e=>e.result===`failed`),r=t?`${K(t,`new entry`,`new entries`)}`:`No new entries`;return n.length?e.length===1?`The feed could not be fetched: ${n[0].error??`unknown reason`}`:`${r}; ${K(n.length,`feed`)} could not be fetched.`:`${r}.`}var li=260,ui=320,di=280,fi=10;function pi({vaultId:e,enabled:t}){let n=mr(e,t===!0);return t===!1?(0,Q.jsx)(hi,{children:(0,Q.jsx)(S,{feature:z,vaultId:e,children:`Enable RSS for this vault to follow feeds and read their entries.`})}):t===void 0||!n.feeds&&!n.error?(0,Q.jsx)(hi,{children:(0,Q.jsx)(f,{status:`loading`,children:`Loading RSS…`})}):n.feeds?(0,Q.jsx)(mi,{vaultId:e,feeds:n}):(0,Q.jsx)(hi,{children:(0,Q.jsx)(f,{status:`error`,children:n.error})})}function mi({vaultId:e,feeds:n}){let[r,i]=t(),o=(0,Z.useRef)(null),s=r.get(`source`),c=cr(e,!0),l=or(e,s??void 0,!0),u=(0,Z.useMemo)(()=>mt(n.feeds??[],c),[n.feeds,c]),{sources:d}=u,f=d.find(e=>e.id===s)??(s?.startsWith(`tag:`)?{id:s,title:s.slice(4),kind:`tag`,tag:s.slice(4)}:void 0),[p,h]=(0,Z.useState)(),[g,_]=(0,Z.useState)(!1),v=f?n.feeds?.find(e=>e.id===f.id):void 0,y=f?l.entries:void 0,b=y?.find(e=>e.id===r.get(`entry`)),S=ue(),[C,w]=ae(Ie),[T,E]=(0,Z.useState)(()=>B(Re,{vaultId:e})),D=v?v.display:f?T:void 0,O=f?.kind===`tag`,k=!(ct(f?.id)||O&&C.tagRead===`ignore`),A=(0,Z.useMemo)(()=>k?O?{...C,read:C.tagRead===`hide`?`hide`:`fade`}:C:{...C,read:`fade`},[C,k,O]),j=f&&k&&A.read===`hide`&&(D?.layout===`grid`||S&&b)?f.id:void 0,ee=(0,Z.useRef)({ids:new Set}),M=(0,Z.useMemo)(()=>{if(!y)return;let e=ee.current;if(e.showing!==j&&(e.showing=j,e.ids=new Set),j)for(let t of y)t.custom?.readAt&&t.id!==b?.id||e.ids.add(t.id);return Oe(y,A,b?.id,j?e.ids:void 0,{distinguishRead:k})},[y,A,b?.id,j,k]),N=fr(y,b,f?.id,A,{distinguishRead:k});ur(b,y,l);let P=(0,Z.useMemo)(()=>hr(N??M?.map(e=>e.entry),b?.id),[N,M,b?.id]),te=(0,Z.useMemo)(()=>[...new Set([...it(n.feeds),...c?.tags.map(e=>e.tag)??[]])].sort((e,t)=>e.localeCompare(t)),[n.feeds,c]),F=(0,Z.useRef)(null),[ne,re]=(0,Z.useState)(),[L,R]=(0,Z.useState)(!1),[z,V]=(0,Z.useState)(),H=m(),oe=de(o),U=Math.max(ui,oe-di-li-fi),[le,W]=se(Ne,{min:ui,max:U,fallback:Math.round(oe*.4)}),K=Math.max(li,oe-di-(b?le+fi:0)),[fe,pe]=se(Le,{min:li,max:K,fallback:360}),q=dr(b,l.update),me=(0,Z.useRef)(!1),he=(0,Z.useRef)(!1),[ge,_e]=(0,Z.useState)(),ve=S&&!!f&&ge===f?.id&&!l.error,ye=(e,t=!1)=>{me.current=!0,S&&_e(e),Y({source:e},t)},be=e=>{_e(void 0),Y({source:e})},xe=(0,Z.useRef)(void 0),J=(0,Z.useRef)(void 0),Se=e=>{S?q.openingOnItsOwn(e):q.openingByChoice(e)},Y=(e,t=!1)=>{e.source!==f?.id&&(J.current=void 0),i(Object.fromEntries(Object.entries(e).filter(e=>!!e[1])),{replace:t})},Ce=e=>{f&&(q.engage(),Se(e),Y({source:f.id,entry:e},!0))},we=e=>{if(F.current?.step(e))return;let t=e===1?P.next:P.previous;t&&Ce(t.id)},Te=(e,t=5)=>requestAnimationFrame(()=>{let n=document.querySelector(e);n?.focus({preventScroll:!0}),(!n||document.activeElement!==n)&&t>1&&Te(e,t-1)}),De=e=>{Y({}),Te(`.rss-view [aria-label="${CSS.escape(`Open ${e}`)}"]`)},ke=()=>h({mode:`add`}),Ae=e=>h({mode:`edit`,id:e}),je=e=>h({mode:`add`,copyOf:e}),Me=e=>re(e),Fe=async()=>{if(ne&&!L){R(!0);try{await n.remove(ne.id),re(void 0),Y({}),Te(`.rss-view [aria-label="Open Inbox"]`)}catch(e){H.error(`The feed could not be removed: ${G(e)}`)}finally{R(!1)}}},ze=async e=>{if(!z&&d.length){V(e);try{let t=e===`all`?await n.fetchAll():[await n.fetch(e)],r=ci(t);t.some(e=>e.result===`failed`)?H.error(r):H.success(r)}catch(e){H.error(`Feeds could not be fetched: ${G(e)}`)}finally{V(void 0)}}},Be=async(e,t)=>{try{await l.update(e,q.withRead(e,t))}catch(e){throw H.error(`The entry could not be updated: ${G(e)}`),e}},Ve=t=>{if(v)n.edit(v.id,{display:{layout:t}}).catch(e=>H.error(`The layout could not be saved: ${G(e)}`));else{let n={...T,layout:t};E(n),ce(Re,n,{vaultId:e})}};(0,Z.useLayoutEffect)(()=>{if(he.current||(he.current=!0,r.get(`source`)||!d.length))return;if(B(Pe)){ye(`all`,!0);return}let t=S?void 0:B(Ee,{vaultId:e});t&&d.some(e=>e.id===t.source)&&(t.entry&&q.openingOnItsOwn(t.entry),Y(t,!0))}),(0,Z.useEffect)(()=>{f?.id!==xe.current&&(xe.current=f?.id,J.current=f&&!r.get(`entry`)&&(!S||me.current)?f.id:void 0,me.current=!1)});let He=M?.[0]?.entry.id;(0,Z.useEffect)(()=>{f&&J.current===f.id&&M&&(J.current=void 0,!He||r.get(`entry`)?He||_e(void 0):(q.openingOnItsOwn(He),Y({source:f.id,entry:He},!0)))});let Ue=f?.id,X=r.get(`entry`)??void 0;(0,Z.useEffect)(()=>{Ue&&ce(Ee,{source:Ue,...X?{entry:X}:{}},{vaultId:e})},[e,Ue,X]);let We=async(e,t=!0)=>{if(!f)return;let n=gr(N??M?.map(e=>e.entry)??[],e.id);await Be(e,{hidden:t}).then(()=>{t?C.only===`hidden`?H.success(`Entry hidden.`):(S?n?Ce(n.id):De(f.title):Y({source:f.id}),H.success(`Entry hidden. It shows again with Show only: Hidden in the filter.`)):H.success(`Entry shown again.`)},()=>void 0)};_r(ve,Ue,X,()=>_e(void 0));let Ge=(e,t)=>{Be(e,{read:t}).then(()=>H.success(t?`Marked as read.`:`Marked as unread.`),()=>void 0)},Ke=()=>_(!0),qe={startAdding:ke,openProfiles:Ke,startEditing:Ae,startDuplicating:je,askRemove:Me,runFetch:ze,feedback:Be,hide:We,step:we},Je=(0,Z.useRef)(qe);Je.current=qe;let Ye=v?.id,Xe=v?.name,Ze=b,Qe=d.length>0,$e=!!P.next,et=!!P.previous,tt=(0,Z.useMemo)(()=>vr({following:Qe,feed:Ye&&Xe?{id:Ye,name:Xe}:void 0,entry:Ze,hasNext:$e,hasPrevious:et},()=>Je.current),[Ye,Xe,Ze,Qe,$e,et]);a(`rss`,tt);let nt=v&&(z===v.id||z===`all`?`Fetching…`:v.status.error?`The last fetch failed: ${v.status.error.message}`:void 0);return(0,Q.jsxs)(hi,{subtitle:vt(d),viewRef:o,actions:(0,Q.jsx)(Cr,{following:Qe,fetching:z,onFetchAll:()=>void ze(`all`),onAdd:ke,onProfiles:Ke}),children:[(0,Q.jsx)(Zn,{sources:d,views:u.views,tags:u.tags,feeds:u.feeds,counts:u.counts,unread:u.unread,selected:f?.id,active:!f,fetching:!!z,onAdd:ke,onSelect:e=>ye(e),onOpenList:S?be:void 0,actions:{edit:Ae,duplicate:je,fetch:e=>void ze(e),remove:e=>{let t=n.feeds?.find(t=>t.id===e);t&&Me({id:e,name:t.name})}}}),g&&(0,Q.jsx)(si,{vaultId:e,onClose:()=>_(!1),onOpenEntry:e=>{_(!1),Y({source:e.feedId,entry:e.entryId})}}),(0,Q.jsx)(Jn,{vaultId:e,state:p,feeds:n,onClose:()=>h(void 0),onAdded:e=>{h(void 0),Y({source:e.id})},onRemove:e=>{h(void 0),Me({id:e.id,name:e.name})}}),f&&(0,Q.jsxs)(ie,{className:`rss-panel-stack${b?` with-article`:``}`,"aria-label":`${f.title} columns`,children:[!ve&&(0,Q.jsx)(Nn,{source:f,entries:M,selected:b?.id,active:!b,display:D,error:l.error,resize:{label:`Resize entries`,value:fe,min:li,max:K,onChange:pe},actions:(0,Q.jsx)(Sr,{feed:v,title:f.title,display:D,filter:C,fetching:!!z,isTag:O,hasReadStatus:k,onFilter:w,onLayout:Ve,onFetch:()=>void ze(v?v.id:`all`),onEdit:()=>v&&Ae(v.id),onRemove:()=>v&&Me({id:v.id,name:v.name}),...f.id===`all`?{inboxFeeds:ft(n.feeds),onInboxFeed:(e,t)=>void n.edit(e,{inbox:t}).catch(e=>H.error(`The Inbox could not be changed: ${G(e)}`))}:{}}),total:l.total,unread:l.unread,hasMore:l.hasMore,loadingMore:l.loadingMore,onLoadMore:l.loadMore,notice:nt,listScope:JSON.stringify(C),emptyMessage:v?`Nothing kept yet. Fetch updates to read the feed now.`:f.id===`starred`?`No starred items yet. Star entries to read them here.`:f.id===`liked`?`No liked items yet. Like entries to read them here.`:f.kind===`tag`?`No entries with #${f.title} yet.`:`Fetch all to read the feeds this vault follows.`,onSelect:e=>{Se(e),Y({source:f.id,entry:e})},onClose:()=>De(f.title)}),b&&(0,Q.jsx)(xn,{vaultId:e,entry:b,availableTags:te,previous:P.previous,next:P.next,carousel:F,onNavigate:Ce,onScrolledDown:S?void 0:q.engage,resize:{label:`Resize article`,value:le,min:ui,max:U,onChange:W},onFeedback:e=>Be(b,e),onHide:e=>void We(b,e),onRead:e=>Ge(b,e),onShowList:S?()=>be(f.id):void 0,onClose:()=>S?De(f.title):Y({source:f.id})})]}),ne&&(0,Q.jsx)(x,{title:`Remove feed?`,confirmLabel:`Remove feed`,tone:`danger`,busy:L,onCancel:()=>re(void 0),onConfirm:()=>void Fe(),children:(0,Q.jsxs)(I,{children:[`This vault stops following `,ne.name,`, on every copy of it, and the entries it kept go too.`]})})]})}function hi({subtitle:e,actions:t,viewRef:n,children:r}){return u(),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`header`,{className:`view-header rss-view-header`,children:(0,Q.jsx)(w,{"aria-label":`RSS toolbar`,slotLeft:(0,Q.jsx)(i,{title:`RSS`,subtitle:e}),slotRight:t})}),(0,Q.jsx)(`main`,{ref:n,className:`main-content content-full-size rss-view document-scroller`,"data-keyboard-list":`true`,children:r})]})}export{pi as RssView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.rss-source-preview{flex-direction:column;gap:16px;display:flex}.rss-source-preview-email{border-top:1px solid var(--border);flex-direction:column;gap:8px;padding-top:12px;display:flex}.rss-source-preview-email-header{flex-direction:column;gap:4px;display:flex}.rss-source-preview-email-meta{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rss-source-preview-entries{flex-direction:column;gap:8px;margin:0;padding-left:20px;display:flex}.rss-source-preview-summary{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.popup.rss-profiles-popup.is-split{width:min(1180px,100%);height:min(780px,100dvh - 40px)}.rss-profiles-popup>.popup-body{padding:0}.rss-profiles-layout{grid-template-columns:1fr;height:100%;min-height:0;display:grid}.rss-profiles-popup.is-split .rss-profiles-layout{grid-template-columns:minmax(240px,300px) minmax(0,1fr)}.rss-profiles-list-column{flex-direction:column;gap:10px;min-height:0;padding:12px;display:flex;overflow:auto}.rss-profiles-new{justify-content:center;align-self:stretch}.rss-profiles-popup.is-split .rss-profiles-list-column{border-right:1px solid var(--border-strong)}.rss-profiles-main{flex-direction:column;gap:12px;min-width:0;min-height:0;padding:18px;display:flex;overflow:auto}.rss-profile-row.is-active .mobile-simple-list-subtitle{color:var(--accent-text)}.rss-profile-pane{flex-direction:column;flex:auto;gap:12px;min-height:0;display:flex}.rss-profile-pane-header p{margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.rss-profile-source{border:1px solid var(--border);background:var(--code-surface);border-radius:6px;flex:auto;min-height:320px;overflow:hidden}.rss-profile-source>*{height:100%}.rss-profile-wizard>p{margin:0}.rss-profile-wizard-choices{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rss-profile-wizard-spacer{flex:auto}.rss-profile-feedback{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));align-items:start;gap:16px;display:grid}.rss-profile-feedback-group{flex-direction:column;gap:6px;min-width:0;display:flex}.rss-profile-feedback-heading{align-items:center;gap:6px;margin:0;display:flex}.rss-profile-feedback-heading svg{width:16px;height:16px}.rss-profile-feedback-group.is-like .rss-profile-feedback-heading svg{color:var(--ui-text-success)}.rss-profile-feedback-group.is-dislike .rss-profile-feedback-heading svg{color:var(--ui-text-danger)}.rss-profile-feedback-list .is-left-out{opacity:.5}.rss-profile-pane .tabs{flex-direction:column;flex:auto;gap:10px;min-height:0;display:flex}.rss-profile-pane .tabs-panel{flex-direction:column;flex:auto;gap:10px;min-height:0;display:flex;overflow:auto}.rss-profile-test-controls{align-items:center;gap:8px;display:flex}.rss-profile-test{flex-direction:column;gap:12px;display:flex}.rss-profile-test-score{border:1px solid var(--border);border-radius:8px;align-items:center;gap:16px;padding:12px 14px;display:flex}.rss-profile-test-score p{margin:0}.rss-profile-test-number{font-variant-numeric:tabular-nums;color:var(--accent-text);margin:0}.rss-profile-test-like{font-variant-numeric:tabular-nums;padding-inline:6px}.rss-profile-test-rows .is-miss .rss-profile-test-like{color:var(--ui-text-danger)}.rss-profile-test-rows .mobile-simple-list-leading svg{width:16px;height:16px}.rss-profile-pane .tabs-bar,.rss-profile-pane-header{flex:none}.rss-profile-test-rows .mobile-simple-list-actions{opacity:1}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./note-excalidraw-editor-
|
|
1
|
+
import"./note-excalidraw-editor-fDQ1JVBh.js";var e={paste:`Вставить`,pasteAsPlaintext:`Вставить как обычный текст`,pasteCharts:`Вставить диаграммы`,selectAll:`Выбрать всё`,multiSelect:`Добавить элемент в выделенный фрагмент`,moveCanvas:`Переместить холст`,cut:`Вырезать`,copy:`Копировать`,copyAsPng:`Скопировать в буфер обмена как PNG`,copyAsSvg:`Скопировать в буфер обмена как SVG`,copyText:`Скопировать в буфер обмена как текст`,copySource:`Копировать источник в буфер обмена`,convertToCode:`Преобразовать в код`,bringForward:`Переместить вперед`,sendToBack:`На задний план`,bringToFront:`На передний план`,sendBackward:`Переместить назад`,delete:`Удалить`,copyStyles:`Скопировать стили`,pasteStyles:`Вставить стили`,stroke:`Обводка`,background:`Фон`,fill:`Заливка`,strokeWidth:`Толщина штриха`,strokeStyle:`Стиль обводки`,strokeStyle_solid:`Сплошная`,strokeStyle_dashed:`Пунктирная`,strokeStyle_dotted:`Точечная`,sloppiness:`Стиль обводки`,opacity:`Непрозрачность`,textAlign:`Выравнивание текста`,edges:`Края`,sharp:`Острые`,round:`Скругленные`,arrowheads:`Стрелка`,arrowhead_none:`Нет`,arrowhead_arrow:`Cтрелка`,arrowhead_bar:`Черта`,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:`Треугольник`,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,fontSize:`Размер шрифта`,fontFamily:`Семейство шрифтов`,addWatermark:`Добавить «Создано в Excalidraw»`,handDrawn:`От руки`,normal:`Обычный`,code:`Код`,small:`Малый`,medium:`Средний`,large:`Большой`,veryLarge:`Очень большой`,solid:`Однотонная`,hachure:`Штрихованная`,zigzag:`Зигзаг`,crossHatch:`Перекрестная`,thin:`Тонкая`,bold:`Жирная`,left:`Слева`,center:`Центр`,right:`Справа`,extraBold:`Очень жирная`,architect:`Архитектор`,artist:`Художник`,cartoonist:`Карикатурист`,fileTitle:`Имя файла`,colorPicker:`Выбор цвета`,canvasColors:`Используется на холсте`,canvasBackground:`Фон холста`,drawingCanvas:`Полотно`,layers:`Слои`,actions:`Действия`,language:`Язык`,liveCollaboration:`Онлайн взаимодействие...`,duplicateSelection:`Дубликат`,untitled:`Безымянный`,name:`Имя`,yourName:`Ваше имя`,madeWithExcalidraw:`Сделано в Excalidraw`,group:`Сгруппировать выделение`,ungroup:`Разделить выделение`,collaborators:`Участники`,showGrid:`Показать сетку`,addToLibrary:`Добавить в библиотеку`,removeFromLibrary:`Удалить из библиотеки`,libraryLoadingMessage:`Загрузка библиотеки…`,libraries:`Просмотреть библиотеки`,loadingScene:`Загрузка сцены…`,align:`Выровнять`,alignTop:`Выровнять по верхнему краю`,alignBottom:`Выровнять по нижнему краю`,alignLeft:`Выровнять по левому краю`,alignRight:`Выровнять по правому краю`,centerVertically:`Центрировать по вертикали`,centerHorizontally:`Центрировать по горизонтали`,distributeHorizontally:`Распределить по горизонтали`,distributeVertically:`Распределить по вертикали`,flipHorizontal:`Переворот по горизонтали`,flipVertical:`Переворот по вертикали`,viewMode:`Вид`,share:`Поделиться`,showStroke:`Показать выбор цвета обводки`,showBackground:`Показать выбор цвета фона`,toggleTheme:`Переключить тему`,personalLib:`Личная библиотека`,excalidrawLib:`Библиотека Excalidraw`,decreaseFontSize:`Уменьшить шрифт`,increaseFontSize:`Увеличить шрифт`,unbindText:`Отвязать текст`,bindText:`Привязать текст к контейнеру`,createContainerFromText:`Поместить текст в контейнер`,link:{edit:`Редактировать ссылку`,editEmbed:``,create:`Создать ссылку`,createEmbed:``,label:`Ссылка`,labelEmbed:``,empty:``},lineEditor:{edit:`Редактирование строки`,exit:`Выход из редактора строки`},elementLock:{lock:`Блокировать`,unlock:`Разблокировать`,lockAll:`Заблокировать все`,unlockAll:`Разблокировать все`},statusPublished:`Опубликовано`,sidebarLock:`Держать боковую панель открытой`,selectAllElementsInFrame:``,removeAllElementsFromFrame:``,eyeDropper:`Взять образец цвета с холста`,textToDiagram:`Текст в диаграмму`,prompt:``},t={noItems:`Пока ничего не добавлено...`,hint_emptyLibrary:`Выберите объект на холсте, чтобы добавить его сюда, или установите библиотеку из публичного репозитория ниже.`,hint_emptyPrivateLibrary:`Выберите объект на холсте, чтобы добавить его сюда.`},n={clearReset:`Очистить холст и сбросить цвет фона`,exportJSON:`Сохранить в`,exportImage:`Экспортировать изображение...`,export:`Сохранить как...`,copyToClipboard:`Скопировать в буфер обмена`,save:`Сохранить в текущий файл`,saveAs:`Сохранить как`,load:`Открыть`,getShareableLink:`Получить доступ по ссылке`,close:`Закрыть`,selectLanguage:`Выбрать язык`,scrollBackToContent:`Вернуться к содержимому`,zoomIn:`Увеличить`,zoomOut:`Уменьшить`,resetZoom:`Сбросить масштаб`,menu:`Меню`,done:`Готово`,edit:`Изменить`,undo:`Шаг назад`,redo:`Шаг вперед`,resetLibrary:`Сброс библиотеки`,createNewRoom:`Создать новую комнату`,fullScreen:`Полный экран`,darkMode:`Темная тема`,lightMode:`Светлая тема`,zenMode:`Режим Дзен`,objectsSnapMode:`Привязка к объектам`,exitZenMode:`Выключить режим концентрации внимания`,cancel:`Отменить`,clear:`Очистить`,remove:`Удалить`,embed:``,publishLibrary:`Опубликовать`,submit:`Отправить`,confirm:`Подтвердить`,embeddableInteractionButton:``},r={clearReset:`Это очистит весь холст. Вы уверены?`,couldNotCreateShareableLink:`Не удалось создать общедоступную ссылку.`,couldNotCreateShareableLinkTooBig:`Нельзя создать ссылку, чтобы поделиться. Сцена слишком большая`,couldNotLoadInvalidFile:`Не удалось загрузить недопустимый файл`,importBackendFailed:`Не удалось импортировать из бэкэнда.`,cannotExportEmptyCanvas:`Не может экспортировать пустой холст.`,couldNotCopyToClipboard:`Не удалось скопировать в буфер обмена.`,decryptFailed:`Не удалось расшифровать данные.`,uploadedSecurly:`Загружаемые данные защищена сквозным шифрованием, что означает, что сервер Excalidraw и третьи стороны не могут прочитать содержимое.`,loadSceneOverridePrompt:`Загрузка рисунка приведёт к замене имеющегося содержимого. Вы хотите продолжить?`,collabStopOverridePrompt:`Остановка сессии перезапишет ваш предыдущий, локально сохранённый рисунок. Вы уверены?
|
|
2
2
|
|
|
3
3
|
(Если вы хотите оставить ваш локальный рисунок, просто закройте вкладку браузера)`,errorAddingToLibrary:`Не удалось добавить объект в библиотеку`,errorRemovingFromLibrary:`Не удалось удалить объект из библиотеки`,confirmAddLibrary:`Будет добавлено {{numShapes}} фигур в вашу библиотеку. Продолжить?`,imageDoesNotContainScene:`Это изображение не содержит данных сцены. Вы включили встраивание сцены во время экспорта?`,cannotRestoreFromImage:`Сцена не может быть восстановлена из этого изображения`,invalidSceneUrl:`Невозможно импортировать сцену с предоставленного URL. Неверный формат, или не содержит верных Excalidraw JSON данных.`,resetLibrary:`Это очистит вашу библиотеку. Вы уверены?`,removeItemsFromsLibrary:`Удалить {{count}} объект(ов) из библиотеки?`,invalidEncryptionKey:`Ключ шифрования должен состоять из 22 символов. Одновременное редактирование отключено.`,collabOfflineWarning:`Отсутствует интернет-соединение.
|
|
4
4
|
Ваши изменения не будут сохранены!`},i={unsupportedFileType:`Неподдерживаемый тип файла.`,imageInsertError:`Не удалось вставить изображение. Попробуйте позже...`,fileTooBig:`Очень большой файл. Максимально разрешенный размер {{maxSize}}.`,svgImageInsertError:`Не удалось вставить изображение SVG. Разметка SVG выглядит недействительной.`,failedToFetchImage:`Не удалось получить изображение.`,invalidSVGString:`Некорректный SVG.`,cannotResolveCollabServer:`Не удалось подключиться к серверу совместного редактирования. Перезагрузите страницу и повторите попытку.`,importLibraryError:`Не удалось загрузить библиотеку`,collabSaveFailed:`Не удалось сохранить в базу данных. Если проблема повторится, нужно будет сохранить файл локально, чтобы быть уверенным, что вы не потеряете вашу работу.`,collabSaveFailed_sizeExceeded:`Не удалось сохранить в базу данных. Похоже, что холст слишком большой. Нужно сохранить файл локально, чтобы быть уверенным, что вы не потеряете вашу работу.`,imageToolNotSupported:`Изображения отключены.`,brave_measure_text_error:{line1:`Похоже, вы используете браузер Brave с включенной опцией <bold>Агрессивно блокировать отслеживание</bold>.`,line2:`Это может привести к поломке <bold>Текстовых объектов</bold> на рисунке.`,line3:`Мы настоятельно рекомендуем отключить эту настройку. Для этого нужно выполнить <link>эти шаги</link>.`,line4:`Если отключение этой настройки не исправит отображение текстовых объектов, создайте <issueLink>issue</issueLink> на нашем GitHub или напишите нам в <discordLink>Discord</discordLink>`},libraryElementTypeError:{embeddable:``,iframe:`Элементы IFrame не могут быть добавлены в библиотеку.`,image:``},asyncPasteFailedOnRead:`Не удалось вставить (невозможно прочитать из системного буфера обмена).`,asyncPasteFailedOnParse:`Не удалось вставить.`,copyToSystemClipboardFailed:`Не удалось скопировать в буфер обмена.`},a={selection:`Выделение области`,image:`Вставить изображение`,rectangle:`Прямоугольник`,diamond:`Ромб`,ellipse:`Эллипс`,arrow:`Cтрелка`,line:`Линия`,freedraw:`Чертить`,text:`Текст`,library:`Библиотека`,lock:`Сохранять выбранный инструмент активным после рисования`,penMode:`Режим пера - предотвращение касания`,link:`Добавить/обновить ссылку для выбранной фигуры`,eraser:`Ластик`,frame:``,magicframe:``,embeddable:``,laser:`Лазерная указка`,hand:`Рука (перемещение холста)`,extraTools:``,mermaidToExcalidraw:`Из Mermaid в Excalidraw`,magicSettings:`Параметры AI`},o={canvasActions:`Операции холста`,selectedShapeActions:`Операции выбранной фигуры`,shapes:`Фигуры`},s={canvasPanning:`Чтобы двигать холст, удерживайте колесо мыши или пробел во время перетаскивания, или используйте инструмент "Рука"`,linearElement:`Нажмите, чтобы начать несколько точек, перетащите для одной линии`,freeDraw:`Нажмите и перетаскивайте, отпустите по завершении`,text:`Совет: при выбранном инструменте выделения дважды щёлкните в любом месте, чтобы добавить текст`,embeddable:``,text_selected:`Дважды щелкните мышью или нажмите ENTER, чтобы редактировать текст`,text_editing:`Нажмите Escape либо Ctrl или Cmd + ENTER для завершения редактирования`,linearElementMulti:`Кликните на последней точке или нажмите Escape или Enter чтобы закончить`,lockAngle:`Вы можете ограничить угол удерживая SHIFT`,resize:`Вы можете ограничить пропорции, удерживая SHIFT во время изменения размеров,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{Gn as r,_r as i,sr as a}from"./index-BVDhmwI8.js";import{r as o}from"./safe-block-qr-button-CD7cJG3N.js";var s=n();function c(e){return/[0-9]/.test(e)?` large-type-digit`:/[A-Za-z]/.test(e)?``:` large-type-symbol`}function l({title:e,text:t,onClose:n}){return(0,s.jsx)(r,{title:e,size:`large`,className:`large-type-popup`,closeLabel:`Close`,dismissOnBackdrop:!0,onCancel:n,children:(0,s.jsx)(`ol`,{className:`large-type-cells`,"aria-label":t,children:[...t].map((e,t)=>(0,s.jsxs)(`li`,{className:`large-type-cell${c(e)}`,"aria-hidden":`true`,children:[(0,s.jsx)(`span`,{className:`large-type-char`,children:e===` `?`\xA0`:e}),(0,s.jsx)(a,{size:`caption`,tone:`muted`,className:`large-type-index`,children:t+1})]},t))})})}var u=e(t(),1),d=7,f=2*Math.PI*d;function p({remaining:e,period:t}){return(0,s.jsxs)(`span`,{className:`otp-countdown${e<=5?` otp-countdown-ending`:``}`,"aria-label":`${e} seconds left`,children:[(0,s.jsxs)(`svg`,{viewBox:`0 0 18 18`,width:`18`,height:`18`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{className:`otp-ring-track`,cx:`9`,cy:`9`,r:d}),(0,s.jsx)(`circle`,{className:`otp-ring`,cx:`9`,cy:`9`,r:d,strokeDasharray:f,strokeDashoffset:f*(1-e/t),transform:`rotate(-90 9 9)`})]}),(0,s.jsx)(`span`,{"aria-hidden":`true`,children:e})]})}function m({secret:e,onCopy:t,onEdit:n}){let[r,c]=(0,u.useState)(()=>Date.now());(0,u.useEffect)(()=>{let e=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let l=o(e,r);return l.kind===`empty`?(0,s.jsx)(a,{size:`small`,tone:`muted`,children:`No secret yet.`}):l.kind===`invalid`?(0,s.jsx)(a,{size:`small`,tone:`danger`,role:`alert`,children:l.message}):(0,s.jsxs)(`span`,{className:`otp-code`,children:[(0,s.jsx)(i,{variant:`link-neutral`,className:`otp-code-value`,"aria-label":`Copy code ${l.code}`,title:n?`Click to copy · Double-click to edit`:`Copy code`,onClick:e=>{e.detail<2&&t(l.code.replace(` `,``))},onDoubleClick:n,children:l.code}),(0,s.jsx)(p,{remaining:l.remaining,period:l.period})]})}function h(e,t,n){if(e!==`otp`)return t;let r=o(t,n);return r.kind===`code`?r.code.replace(` `,``):void 0}export{m as n,l as r,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./qr-viewer-CvEfRC2r.js";import{t}from"./react-B3NTyEzE.js";var n=e=>{let t=new Uint8Array(new ArrayBuffer(8)),n=e;for(let e=7;e>=0&&n!==0;e--)t[e]=n&255,n-=t[e],n/=256;return t};function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}var i=e=>e?`"${e}" `:``;function a(e,t=``){if(typeof e!=`number`)throw TypeError(i(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(i(t)+`expected integer >= 0, got `+e);return e}function o(e,t=``){if(typeof e!=`boolean`)throw TypeError(i(t)+`expected boolean, got type=`+typeof e);return e}function s(e,t,n=``){if(r(e)&&t===void 0)return e;let a=r(e),o=a?`length=${e.length}`:`type=${typeof e}`,s=i(n)+`expected Uint8Array, got `+o;throw a?RangeError(s):TypeError(s)}function c(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(a(e.outputLen),a(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}var l=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},u=(e,t)=>{l(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function d(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function f(e,t){s(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function p(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function m(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function g(e,t){return e<<32-t|e>>>t}function _(e,t){return e<<t|e>>>32-t>>>0}var ee=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function te(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ne(e){for(let t=0;t<e.length;t++)e[t]=te(e[t]);return e}var v=ee?e=>e:ne;function y(e,t,n=`opts`){return u(e,`defaults`),t!==void 0&&u(t,n),Object.assign(Object.create(null),e,t)}function b(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=y({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}var x=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),S=class{update(e){return d(this),this.iHash.update(e),this}digestInto(e){d(this),f(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o,canXOF:s}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.canXOF=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(e,t){if(this.canXOF=!1,this.finished=!1,this.destroyed=!1,c(e),s(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`expected Hash instance`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),m(r)}},C=(()=>{let e=(e,t,n)=>new S(e,t).update(n).digest();return e.create=(e,t)=>new S(e,t),e})(),w=BigInt(2**32-1),T=BigInt(32);function re(e,t=!1){return t?{h:Number(e&w),l:Number(e>>T&w)}:{h:Number(e>>T&w)|0,l:Number(e&w)|0}}function ie(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=re(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var ae=e=>e/2**32|0,oe=e=>e>>>0;function se(e,t,n,r){let i=ae(n),a=oe(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}var ce=(e,t,n)=>e>>>n,le=(e,t,n)=>e<<32-n|t>>>n,E=(e,t,n)=>e>>>n|t<<32-n,D=(e,t,n)=>e<<32-n|t>>>n,O=(e,t,n)=>e<<64-n|t>>>n-32,k=(e,t,n)=>e>>>n-32|t<<64-n;function A(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var ue=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),de=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,fe=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),pe=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,me=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),he=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function j(e,t,n){return e&t^~e&n}function ge(e,t,n){return e&t^e&n^t&n}var M=class{update(e){d(this),s(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=h(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0}else n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){d(this),f(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),se(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:h(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}constructor(e,t,n,r){this.canXOF=!1,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}},_e=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ve=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ye=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),be=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),N=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),P=new Uint32Array(80),xe=class extends M{get(){let{A:e,B:t,C:n,D:r,E:i}=this;return[e,t,n,r,i]}set(e,t,n,r,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)P[n]=e.getUint32(t,!1);for(let e=16;e<80;e++)P[e]=_(P[e-3]^P[e-8]^P[e-14]^P[e-16],1);let{A:n,B:r,C:i,D:a,E:o}=this;for(let e=0;e<80;e++){let t,s;e<20?(t=j(r,i,a),s=1518500249):e<40?(t=r^i^a,s=1859775393):e<60?(t=ge(r,i,a),s=2400959708):(t=r^i^a,s=3395469782);let c=_(n,5)+t+o+s+P[e]|0;o=a,a=i,i=_(r,30),r=n,n=c}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,this.set(n,r,i,a,o)}roundClean(){m(P)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0),m(this.buffer)}constructor(){super(64,20,8,!1),this.A=N[0]|0,this.B=N[1]|0,this.C=N[2]|0,this.D=N[3]|0,this.E=N[4]|0}},Se=b(()=>new xe),Ce=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),F=new Uint32Array(64),I=class extends M{get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)F[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=F[e-15],n=F[e-2],r=g(t,7)^g(t,18)^t>>>3,i=g(n,17)^g(n,19)^n>>>10;F[e]=i+F[e-7]+r+F[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=g(o,6)^g(o,11)^g(o,25),u=l+t+j(o,s,c)+Ce[e]+F[e]|0,d=(g(n,2)^g(n,13)^g(n,22))+ge(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){m(F)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),m(this.buffer)}constructor(e,t){super(64,e,8,!1),this.A=0,this.B=0,this.C=0,this.D=0,this.E=0,this.F=0,this.G=0,this.H=0,this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}},we=class extends I{constructor(){super(32,_e)}},Te=class extends I{constructor(){super(28,ve)}},L=ie(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Ee=L[0],De=L[1],R=new Uint32Array(80),z=new Uint32Array(80),B=class extends M{get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)R[n]=e.getUint32(t),z[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=R[e-15]|0,n=z[e-15]|0,r=E(t,n,1)^E(t,n,8)^ce(t,n,7),i=D(t,n,1)^D(t,n,8)^le(t,n,7),a=R[e-2]|0,o=z[e-2]|0,s=E(a,o,19)^O(a,o,61)^ce(a,o,6),c=fe(i,D(a,o,19)^k(a,o,61)^le(a,o,6),z[e-7],z[e-16]),l=pe(c,r,s,R[e-7],R[e-16]);R[e]=l|0,z[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=E(u,d,14)^E(u,d,18)^O(u,d,41),ee=D(u,d,14)^D(u,d,18)^k(u,d,41),te=u&f^~u&m,ne=d&p^~d&h,v=me(_,ee,ne,De[e],z[e]),y=he(v,g,t,te,Ee[e],R[e]),b=v|0,x=E(n,r,28)^O(n,r,34)^O(n,r,39),S=D(n,r,28)^k(n,r,34)^k(n,r,39),C=n&i^n&o^i&o,w=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=A(c|0,l|0,y|0,b|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let T=ue(b,S,w);n=de(T,y,x,C),r=T|0}({h:n,l:r}=A(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=A(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=A(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=A(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=A(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=A(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=A(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=A(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){m(R,z)}destroy(){this.destroyed=!0,m(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(e,t){super(128,e,16,!1),this.Ah=0,this.Al=0,this.Bh=0,this.Bl=0,this.Ch=0,this.Cl=0,this.Dh=0,this.Dl=0,this.Eh=0,this.El=0,this.Fh=0,this.Fl=0,this.Gh=0,this.Gl=0,this.Hh=0,this.Hl=0,this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}},Oe=class extends B{constructor(){super(64,be)}},ke=class extends B{constructor(){super(48,ye)}},Ae=b(()=>new we,x(1)),je=b(()=>new Te,x(4)),Me=b(()=>new Oe,x(3)),Ne=b(()=>new ke,x(2)),Pe=BigInt(0),V=BigInt(1),Fe=BigInt(2),Ie=BigInt(7),Le=BigInt(256),Re=BigInt(113),H=[],U=[],W=[];for(let e=0,t=V,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],H.push(2*(5*r+n)),U.push((e+1)*(e+2)/2%64);let i=Pe;for(let e=0;e<7;e++)t=(t<<V^(t>>Ie)*Re)%Le,t&Fe&&(i^=V<<(V<<BigInt(e))-V);W.push(i)}var G=ie(W,!0),ze=G[0],Be=G[1],Ve=(e,t,n)=>e<<n|t>>>32-n,He=(e,t,n)=>t<<n|e>>>32-n,Ue=(e,t,n)=>t<<n-32|e>>>64-n,We=(e,t,n)=>e<<n-32|t>>>64-n,Ge=(e,t,n)=>n>32?Ue(e,t,n):Ve(e,t,n),Ke=(e,t,n)=>n>32?We(e,t,n):He(e,t,n),K=new Uint32Array(10);function qe(e,t=24){if(!(e instanceof Uint32Array))throw TypeError(`"s" expected Uint32Array(50), got type=`+typeof e);if(e.length!==50)throw RangeError(`"s" expected Uint32Array(50), got length=`+e.length);if(a(t,`rounds`),t<1||t>24)throw Error(`"rounds" expected integer 1..24`);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)K[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,r=(t+2)%10,i=K[r],a=K[r+1],o=Ge(i,a,1)^K[n],s=Ke(i,a,1)^K[n+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=s}let t=e[2],r=e[3];for(let n=0;n<24;n++){let i=U[n],a=Ge(t,r,i),o=Ke(t,r,i),s=H[n];t=e[s],r=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3];e[t]^=~e[t+2]&e[t+4],e[t+1]^=~e[t+3]&e[t+5],e[t+2]^=~e[t+4]&e[t+6],e[t+3]^=~e[t+5]&e[t+7],e[t+4]^=~e[t+6]&e[t+8],e[t+5]^=~e[t+7]&e[t+9],e[t+6]^=~e[t+8]&n,e[t+7]^=~e[t+9]&r,e[t+8]^=~n&i,e[t+9]^=~r&a}e[0]^=ze[n],e[1]^=Be[n]}m(K)}var Je=class e{clone(){return this._cloneInto()}keccak(){v(this.state32),qe(this.state32,this.rounds),v(this.state32),this.posOut=0,this.pos=0}update(e){d(this),s(e);let{blockLen:t,state:n,state32:r}=this,i=e.length,a=t%4==0&&e.byteOffset%4==0,o=t/4,c=a&&i>=t?p(e):void 0;for(let a=0;a<i;){if(c!==void 0&&this.pos===0&&a%4==0&&i-a>=t){for(let e=0,t=a/4;e<o;e++)r[e]^=c[t+e];a+=t,this.pos=t,this.keccak();continue}let s=Math.min(t-this.pos,i-a);for(let t=0;t<s;t++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){d(this,!1),s(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not enabled`);return this.writeInto(e)}xof(e){return a(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(f(e,this),this.finished)throw Error(`digest() was already called`);this.writeInto(e.length===this.outputLen?e:e.subarray(0,this.outputLen)),this.destroy()}digest(){let e=new Uint8Array(this.outputLen);return this.digestInto(e),e}destroy(){this.destroyed=!0,m(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.blockLen=n,t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.canXOF=this.canXOF,t.destroyed=this.destroyed,t}constructor(e,t,n,r=!1,i=24){if(this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,a(e,`blockLen`),a(t,`suffix`),a(i,`rounds`),o(r,`enableXOF`),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.canXOF=r,this.rounds=i,a(n,`outputLen`),!(0<e&&e<200))throw Error(`"blockLen" must be 1..199`);this.state=new Uint8Array(200),this.state32=p(this.state)}},q=(e,t,n,r={})=>b(()=>new Je(t,e,n),r),Ye=q(6,144,28,x(7)),Xe=q(6,136,32,x(8)),Ze=q(6,104,48,x(9)),Qe=q(6,72,64,x(10)),J=(()=>{if(typeof globalThis==`object`)return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<`u`)return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global})(),$e={SHA1:Se,SHA224:je,SHA256:Ae,SHA384:Ne,SHA512:Me,"SHA3-224":Ye,"SHA3-256":Xe,"SHA3-384":Ze,"SHA3-512":Qe},Y=e=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(e):return`SHA1`;case/^SHA(?:2?-)?224$/i.test(e):return`SHA224`;case/^SHA(?:2?-)?256$/i.test(e):return`SHA256`;case/^SHA(?:2?-)?384$/i.test(e):return`SHA384`;case/^SHA(?:2?-)?512$/i.test(e):return`SHA512`;case/^SHA3-224$/i.test(e):return`SHA3-224`;case/^SHA3-256$/i.test(e):return`SHA3-256`;case/^SHA3-384$/i.test(e):return`SHA3-384`;case/^SHA3-512$/i.test(e):return`SHA3-512`;default:throw TypeError(`Unknown hash algorithm: ${e}`)}},et=(e,t,n)=>{if(C)return C($e[e]??$e[Y(e)],t,n);throw Error(`Missing HMAC function`)},X=`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,tt=e=>{e=e.replace(/ /g,``).toUpperCase();let t=e.length;for(;e[t-1]===`=`;)--t;t<e.length&&(e=e.substring(0,t));let n=new ArrayBuffer(e.length*5/8|0),r=new Uint8Array(n),i=0,a=0,o=0;for(let t=0;t<e.length;t++){let n=X.indexOf(e[t]);if(n===-1)throw TypeError(`Invalid character found: ${e[t]}`);a=a<<5|n,i+=5,i>=8&&(i-=8,r[o++]=a>>>i)}return r},nt=e=>{let t=0,n=0,r=``;for(let i=0;i<e.length;i++)for(n=n<<8|e[i],t+=8;t>=5;)r+=X[n>>>t-5&31],t-=5;return t>0&&(r+=X[n<<5-t&31]),r},rt=`0123456789ABCDEF`,it=e=>{e=e.replace(/ /g,``).toUpperCase();let t=new ArrayBuffer(e.length/2),n=new Uint8Array(t);for(let t=0;t<e.length;t+=2){let r=rt.indexOf(e[t]),i=rt.indexOf(e[t+1]);if(r===-1||i===-1)throw TypeError(`Invalid character found: ${e.substring(t,t+2)}`);n[t/2]=r<<4|i}return n},at=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length===1&&(t+=`0`),t+=r}return t.toUpperCase()},ot=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t)&255;return n},st=e=>{let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},ct=J.TextEncoder?new J.TextEncoder:null,lt=J.TextDecoder?new J.TextDecoder:null,ut=e=>{if(!ct)throw Error(`Encoding API not available`);return ct.encode(e)},dt=e=>{if(!lt)throw Error(`Encoding API not available`);return lt.decode(e)},ft=e=>{if(J.crypto?.getRandomValues)return J.crypto.getRandomValues(new Uint8Array(e));throw Error(`Cryptography API not available`)},Z=class e{static fromLatin1(t){return new e({buffer:ot(t).buffer})}static fromUTF8(t){return new e({buffer:ut(t).buffer})}static fromBase32(t){return new e({buffer:tt(t).buffer})}static fromHex(t){return new e({buffer:it(t).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:st(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:dt(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:nt(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:at(this.bytes)}),this.hex}constructor({buffer:e,size:t=20}={}){this.bytes=e===void 0?ft(t):new Uint8Array(e),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}},pt=(e,t)=>{{if(e.length!==t.length)throw TypeError(`Input strings must have the same length`);let n=-1,r=0;for(;++n<e.length;)r|=e.charCodeAt(n)^t.charCodeAt(n);return r===0}},Q=class e{static get defaults(){return{issuer:``,label:`OTPAuth`,issuerInLabel:!0,algorithm:`SHA1`,digits:6,counter:0,window:1}}static generate({secret:t,algorithm:r=e.defaults.algorithm,digits:i=e.defaults.digits,counter:a=e.defaults.counter,hmac:o=et}){let s=n(a),c=o(r,t.bytes,s);if(!c?.byteLength||c.byteLength<19)throw TypeError(`Return value must be at least 19 bytes`);let l=c[c.byteLength-1]&15;return(((c[l]&127)<<24|(c[l+1]&255)<<16|(c[l+2]&255)<<8|c[l+3]&255)%10**i).toString().padStart(i,`0`)}generate({counter:t=this.counter++}={}){return e.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:t,hmac:this.hmac})}static validate({token:t,secret:n,algorithm:r,digits:i=e.defaults.digits,counter:a=e.defaults.counter,window:o=e.defaults.window,hmac:s=et}){if(t.length!==i)return null;let c=null,l=o=>{pt(t,e.generate({secret:n,algorithm:r,digits:i,counter:o,hmac:s}))&&(c=o-a)};l(a);for(let e=1;e<=o&&c===null&&(l(a-e),!(c!==null||(l(a+e),c!==null)));++e);return c}validate({token:t,counter:n=this.counter,window:r}){return e.validate({token:t,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:n,window:r,hmac:this.hmac})}toString(){let e=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}constructor({issuer:t=e.defaults.issuer,label:n=e.defaults.label,issuerInLabel:r=e.defaults.issuerInLabel,secret:i=new Z,algorithm:a=e.defaults.algorithm,digits:o=e.defaults.digits,counter:s=e.defaults.counter,hmac:c}={}){this.issuer=t,this.label=n,this.issuerInLabel=r,this.secret=typeof i==`string`?Z.fromBase32(i):i,this.algorithm=c?a:Y(a),this.digits=o,this.counter=s,this.hmac=c}},$=class e{static get defaults(){return{issuer:``,label:`OTPAuth`,issuerInLabel:!0,algorithm:`SHA1`,digits:6,period:30,window:1}}static counter({period:t=e.defaults.period,timestamp:n=Date.now()}={}){return Math.floor(n/1e3/t)}counter({timestamp:t=Date.now()}={}){return e.counter({period:this.period,timestamp:t})}static remaining({period:t=e.defaults.period,timestamp:n=Date.now()}={}){return t*1e3-n%(t*1e3)}remaining({timestamp:t=Date.now()}={}){return e.remaining({period:this.period,timestamp:t})}static generate({secret:t,algorithm:n,digits:r,period:i=e.defaults.period,timestamp:a=Date.now(),hmac:o}){return Q.generate({secret:t,algorithm:n,digits:r,counter:e.counter({period:i,timestamp:a}),hmac:o})}generate({timestamp:t=Date.now()}={}){return e.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:t,hmac:this.hmac})}static validate({token:t,secret:n,algorithm:r,digits:i,period:a=e.defaults.period,timestamp:o=Date.now(),window:s,hmac:c}){return Q.validate({token:t,secret:n,algorithm:r,digits:i,counter:e.counter({period:a,timestamp:o}),window:s,hmac:c})}validate({token:t,timestamp:n,window:r}){return e.validate({token:t,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:r,hmac:this.hmac})}toString(){let e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}constructor({issuer:t=e.defaults.issuer,label:n=e.defaults.label,issuerInLabel:r=e.defaults.issuerInLabel,secret:i=new Z,algorithm:a=e.defaults.algorithm,digits:o=e.defaults.digits,period:s=e.defaults.period,hmac:c}={}){this.issuer=t,this.label=n,this.issuerInLabel=r,this.secret=typeof i==`string`?Z.fromBase32(i):i,this.algorithm=c?a:Y(a),this.digits=o,this.period=s,this.hmac=c}},mt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,ht=/^[2-7A-Z]+=*$/i,gt=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,_t=/^[A-Z0-9]+(?:[_-][A-Z0-9]+)*$/i,vt=/^[+-]?\d+$/,yt=/^\+?[1-9]\d*$/,bt=class{static parse(e,{hmac:t}={}){let n;try{n=e.match(mt)}catch{}if(!Array.isArray(n))throw URIError(`Invalid URI format`);let r=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),a=n[3].split(`&`).reduce((e,t)=>{let n=t.split(/=(.*)/,2).map(decodeURIComponent),r=n[0].toLowerCase(),i=n[1],a=e;return a[r]=i,a},{}),o,s={};if(r===`hotp`){if(o=Q,a.counter!==void 0&&vt.test(a.counter))s.counter=parseInt(a.counter,10);else throw TypeError(`Missing or invalid 'counter' parameter`)}else if(r===`totp`){if(o=$,a.period!==void 0){if(yt.test(a.period))s.period=parseInt(a.period,10);else throw TypeError(`Invalid 'period' parameter`)}}else throw TypeError(`Unknown OTP type`);if(a.issuer!==void 0&&(s.issuer=a.issuer),i.length===2?(s.label=i[1],s.issuer===void 0||s.issuer===``?s.issuer=i[0]:i[0]===``&&(s.issuerInLabel=!1)):(s.label=i[0],s.issuer!==void 0&&s.issuer!==``&&(s.issuerInLabel=!1)),a.secret!==void 0&&ht.test(a.secret))s.secret=a.secret;else throw TypeError(`Missing or invalid 'secret' parameter`);if(a.algorithm!==void 0){if((t?_t:gt).test(a.algorithm))s.algorithm=a.algorithm;else throw TypeError(`Invalid 'algorithm' parameter`)}if(a.digits!==void 0){if(yt.test(a.digits))s.digits=parseInt(a.digits,10);else throw TypeError(`Invalid 'digits' parameter`)}return t!==void 0&&(s.hmac=t),new o(s)}static stringify(e){if(e instanceof Q||e instanceof $)return e.toString();throw TypeError(`Invalid 'HOTP/TOTP' object`)}};function xt(e,t){let n=e.trim();if(!n)return{kind:`empty`};try{let e=n.toLowerCase().startsWith(`otpauth://`)?bt.parse(n):new $({secret:Z.fromBase32(n.replace(/[\s-]+/g,``).toUpperCase())});if(!(e instanceof $))return{kind:`invalid`,message:`Only time-based codes are supported.`};let r=e.generate({timestamp:t}),i=Math.ceil(r.length/2);return{kind:`code`,code:`${r.slice(0,i)} ${r.slice(i)}`,remaining:e.period-Math.floor(t/1e3)%e.period,period:e.period}}catch{return{kind:`invalid`,message:`This is not a valid secret or otpauth link.`}}}function St(e,t){let n=e.trim();if(n)try{return n.toLowerCase().startsWith(`otpauth://`)?bt.parse(n)instanceof $?n:void 0:new $({issuer:`BrAIan`,label:t,secret:Z.fromBase32(n.replace(/[\s-]+/g,``).toUpperCase())}).toString()}catch{return}}function Ct(e,t,n){if(e===`otp`){let e=St(t,n??`Safe block`);return e?{content:e,caption:`Scan with an authenticator app to add this code.`}:void 0}return t?{content:t}:void 0}var wt=t(),Tt={pwd:`Password`,otp:`One-time password`};function Et({kind:t,text:n,title:r,open:i,onOpenChange:a}){let o=Ct(t,n,r);return o?(0,wt.jsx)(e,{content:o.content,caption:o.caption,title:r??(t?Tt[t]:`Safe block`),open:i,onOpenChange:a}):null}export{Ct as n,xt as r,Et as t};
|
|
1
|
+
import{n as e}from"./qr-viewer-DAOzDI8d.js";import{t}from"./react-B3NTyEzE.js";var n=e=>{let t=new Uint8Array(new ArrayBuffer(8)),n=e;for(let e=7;e>=0&&n!==0;e--)t[e]=n&255,n-=t[e],n/=256;return t};function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}var i=e=>e?`"${e}" `:``;function a(e,t=``){if(typeof e!=`number`)throw TypeError(i(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(i(t)+`expected integer >= 0, got `+e);return e}function o(e,t=``){if(typeof e!=`boolean`)throw TypeError(i(t)+`expected boolean, got type=`+typeof e);return e}function s(e,t,n=``){if(r(e)&&t===void 0)return e;let a=r(e),o=a?`length=${e.length}`:`type=${typeof e}`,s=i(n)+`expected Uint8Array, got `+o;throw a?RangeError(s):TypeError(s)}function c(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(a(e.outputLen),a(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}var l=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},u=(e,t)=>{l(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function d(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function f(e,t){s(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function p(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function m(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function g(e,t){return e<<32-t|e>>>t}function _(e,t){return e<<t|e>>>32-t>>>0}var ee=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function te(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ne(e){for(let t=0;t<e.length;t++)e[t]=te(e[t]);return e}var v=ee?e=>e:ne;function y(e,t,n=`opts`){return u(e,`defaults`),t!==void 0&&u(t,n),Object.assign(Object.create(null),e,t)}function b(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=y({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}var x=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),S=class{update(e){return d(this),this.iHash.update(e),this}digestInto(e){d(this),f(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o,canXOF:s}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.canXOF=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}constructor(e,t){if(this.canXOF=!1,this.finished=!1,this.destroyed=!1,c(e),s(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`expected Hash instance`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),m(r)}},C=(()=>{let e=(e,t,n)=>new S(e,t).update(n).digest();return e.create=(e,t)=>new S(e,t),e})(),w=BigInt(2**32-1),T=BigInt(32);function re(e,t=!1){return t?{h:Number(e&w),l:Number(e>>T&w)}:{h:Number(e>>T&w)|0,l:Number(e&w)|0}}function ie(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=re(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var ae=e=>e/2**32|0,oe=e=>e>>>0;function se(e,t,n,r){let i=ae(n),a=oe(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}var ce=(e,t,n)=>e>>>n,le=(e,t,n)=>e<<32-n|t>>>n,E=(e,t,n)=>e>>>n|t<<32-n,D=(e,t,n)=>e<<32-n|t>>>n,O=(e,t,n)=>e<<64-n|t>>>n-32,k=(e,t,n)=>e>>>n-32|t<<64-n;function A(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var ue=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),de=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,fe=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),pe=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,me=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),he=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function j(e,t,n){return e&t^~e&n}function ge(e,t,n){return e&t^e&n^t&n}var M=class{update(e){d(this),s(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=h(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0}else n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){d(this),f(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),se(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:h(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}constructor(e,t,n,r){this.canXOF=!1,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}},_e=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ve=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ye=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),be=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),N=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),P=new Uint32Array(80),xe=class extends M{get(){let{A:e,B:t,C:n,D:r,E:i}=this;return[e,t,n,r,i]}set(e,t,n,r,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)P[n]=e.getUint32(t,!1);for(let e=16;e<80;e++)P[e]=_(P[e-3]^P[e-8]^P[e-14]^P[e-16],1);let{A:n,B:r,C:i,D:a,E:o}=this;for(let e=0;e<80;e++){let t,s;e<20?(t=j(r,i,a),s=1518500249):e<40?(t=r^i^a,s=1859775393):e<60?(t=ge(r,i,a),s=2400959708):(t=r^i^a,s=3395469782);let c=_(n,5)+t+o+s+P[e]|0;o=a,a=i,i=_(r,30),r=n,n=c}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,this.set(n,r,i,a,o)}roundClean(){m(P)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0),m(this.buffer)}constructor(){super(64,20,8,!1),this.A=N[0]|0,this.B=N[1]|0,this.C=N[2]|0,this.D=N[3]|0,this.E=N[4]|0}},Se=b(()=>new xe),Ce=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),F=new Uint32Array(64),I=class extends M{get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)F[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=F[e-15],n=F[e-2],r=g(t,7)^g(t,18)^t>>>3,i=g(n,17)^g(n,19)^n>>>10;F[e]=i+F[e-7]+r+F[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=g(o,6)^g(o,11)^g(o,25),u=l+t+j(o,s,c)+Ce[e]+F[e]|0,d=(g(n,2)^g(n,13)^g(n,22))+ge(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){m(F)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),m(this.buffer)}constructor(e,t){super(64,e,8,!1),this.A=0,this.B=0,this.C=0,this.D=0,this.E=0,this.F=0,this.G=0,this.H=0,this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}},we=class extends I{constructor(){super(32,_e)}},Te=class extends I{constructor(){super(28,ve)}},L=ie(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Ee=L[0],De=L[1],R=new Uint32Array(80),z=new Uint32Array(80),B=class extends M{get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)R[n]=e.getUint32(t),z[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=R[e-15]|0,n=z[e-15]|0,r=E(t,n,1)^E(t,n,8)^ce(t,n,7),i=D(t,n,1)^D(t,n,8)^le(t,n,7),a=R[e-2]|0,o=z[e-2]|0,s=E(a,o,19)^O(a,o,61)^ce(a,o,6),c=fe(i,D(a,o,19)^k(a,o,61)^le(a,o,6),z[e-7],z[e-16]),l=pe(c,r,s,R[e-7],R[e-16]);R[e]=l|0,z[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=E(u,d,14)^E(u,d,18)^O(u,d,41),ee=D(u,d,14)^D(u,d,18)^k(u,d,41),te=u&f^~u&m,ne=d&p^~d&h,v=me(_,ee,ne,De[e],z[e]),y=he(v,g,t,te,Ee[e],R[e]),b=v|0,x=E(n,r,28)^O(n,r,34)^O(n,r,39),S=D(n,r,28)^k(n,r,34)^k(n,r,39),C=n&i^n&o^i&o,w=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=A(c|0,l|0,y|0,b|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let T=ue(b,S,w);n=de(T,y,x,C),r=T|0}({h:n,l:r}=A(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=A(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=A(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=A(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=A(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=A(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=A(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=A(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){m(R,z)}destroy(){this.destroyed=!0,m(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}constructor(e,t){super(128,e,16,!1),this.Ah=0,this.Al=0,this.Bh=0,this.Bl=0,this.Ch=0,this.Cl=0,this.Dh=0,this.Dl=0,this.Eh=0,this.El=0,this.Fh=0,this.Fl=0,this.Gh=0,this.Gl=0,this.Hh=0,this.Hl=0,this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}},Oe=class extends B{constructor(){super(64,be)}},ke=class extends B{constructor(){super(48,ye)}},Ae=b(()=>new we,x(1)),je=b(()=>new Te,x(4)),Me=b(()=>new Oe,x(3)),Ne=b(()=>new ke,x(2)),Pe=BigInt(0),V=BigInt(1),Fe=BigInt(2),Ie=BigInt(7),Le=BigInt(256),Re=BigInt(113),H=[],U=[],W=[];for(let e=0,t=V,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],H.push(2*(5*r+n)),U.push((e+1)*(e+2)/2%64);let i=Pe;for(let e=0;e<7;e++)t=(t<<V^(t>>Ie)*Re)%Le,t&Fe&&(i^=V<<(V<<BigInt(e))-V);W.push(i)}var G=ie(W,!0),ze=G[0],Be=G[1],Ve=(e,t,n)=>e<<n|t>>>32-n,He=(e,t,n)=>t<<n|e>>>32-n,Ue=(e,t,n)=>t<<n-32|e>>>64-n,We=(e,t,n)=>e<<n-32|t>>>64-n,Ge=(e,t,n)=>n>32?Ue(e,t,n):Ve(e,t,n),Ke=(e,t,n)=>n>32?We(e,t,n):He(e,t,n),K=new Uint32Array(10);function qe(e,t=24){if(!(e instanceof Uint32Array))throw TypeError(`"s" expected Uint32Array(50), got type=`+typeof e);if(e.length!==50)throw RangeError(`"s" expected Uint32Array(50), got length=`+e.length);if(a(t,`rounds`),t<1||t>24)throw Error(`"rounds" expected integer 1..24`);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)K[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,r=(t+2)%10,i=K[r],a=K[r+1],o=Ge(i,a,1)^K[n],s=Ke(i,a,1)^K[n+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=s}let t=e[2],r=e[3];for(let n=0;n<24;n++){let i=U[n],a=Ge(t,r,i),o=Ke(t,r,i),s=H[n];t=e[s],r=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3];e[t]^=~e[t+2]&e[t+4],e[t+1]^=~e[t+3]&e[t+5],e[t+2]^=~e[t+4]&e[t+6],e[t+3]^=~e[t+5]&e[t+7],e[t+4]^=~e[t+6]&e[t+8],e[t+5]^=~e[t+7]&e[t+9],e[t+6]^=~e[t+8]&n,e[t+7]^=~e[t+9]&r,e[t+8]^=~n&i,e[t+9]^=~r&a}e[0]^=ze[n],e[1]^=Be[n]}m(K)}var Je=class e{clone(){return this._cloneInto()}keccak(){v(this.state32),qe(this.state32,this.rounds),v(this.state32),this.posOut=0,this.pos=0}update(e){d(this),s(e);let{blockLen:t,state:n,state32:r}=this,i=e.length,a=t%4==0&&e.byteOffset%4==0,o=t/4,c=a&&i>=t?p(e):void 0;for(let a=0;a<i;){if(c!==void 0&&this.pos===0&&a%4==0&&i-a>=t){for(let e=0,t=a/4;e<o;e++)r[e]^=c[t+e];a+=t,this.pos=t,this.keccak();continue}let s=Math.min(t-this.pos,i-a);for(let t=0;t<s;t++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){d(this,!1),s(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not enabled`);return this.writeInto(e)}xof(e){return a(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(f(e,this),this.finished)throw Error(`digest() was already called`);this.writeInto(e.length===this.outputLen?e:e.subarray(0,this.outputLen)),this.destroy()}digest(){let e=new Uint8Array(this.outputLen);return this.digestInto(e),e}destroy(){this.destroyed=!0,m(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.blockLen=n,t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.canXOF=this.canXOF,t.destroyed=this.destroyed,t}constructor(e,t,n,r=!1,i=24){if(this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,a(e,`blockLen`),a(t,`suffix`),a(i,`rounds`),o(r,`enableXOF`),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.canXOF=r,this.rounds=i,a(n,`outputLen`),!(0<e&&e<200))throw Error(`"blockLen" must be 1..199`);this.state=new Uint8Array(200),this.state32=p(this.state)}},q=(e,t,n,r={})=>b(()=>new Je(t,e,n),r),Ye=q(6,144,28,x(7)),Xe=q(6,136,32,x(8)),Ze=q(6,104,48,x(9)),Qe=q(6,72,64,x(10)),J=(()=>{if(typeof globalThis==`object`)return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if(typeof __GLOBALTHIS__<`u`)return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global})(),$e={SHA1:Se,SHA224:je,SHA256:Ae,SHA384:Ne,SHA512:Me,"SHA3-224":Ye,"SHA3-256":Xe,"SHA3-384":Ze,"SHA3-512":Qe},Y=e=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(e):return`SHA1`;case/^SHA(?:2?-)?224$/i.test(e):return`SHA224`;case/^SHA(?:2?-)?256$/i.test(e):return`SHA256`;case/^SHA(?:2?-)?384$/i.test(e):return`SHA384`;case/^SHA(?:2?-)?512$/i.test(e):return`SHA512`;case/^SHA3-224$/i.test(e):return`SHA3-224`;case/^SHA3-256$/i.test(e):return`SHA3-256`;case/^SHA3-384$/i.test(e):return`SHA3-384`;case/^SHA3-512$/i.test(e):return`SHA3-512`;default:throw TypeError(`Unknown hash algorithm: ${e}`)}},et=(e,t,n)=>{if(C)return C($e[e]??$e[Y(e)],t,n);throw Error(`Missing HMAC function`)},X=`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,tt=e=>{e=e.replace(/ /g,``).toUpperCase();let t=e.length;for(;e[t-1]===`=`;)--t;t<e.length&&(e=e.substring(0,t));let n=new ArrayBuffer(e.length*5/8|0),r=new Uint8Array(n),i=0,a=0,o=0;for(let t=0;t<e.length;t++){let n=X.indexOf(e[t]);if(n===-1)throw TypeError(`Invalid character found: ${e[t]}`);a=a<<5|n,i+=5,i>=8&&(i-=8,r[o++]=a>>>i)}return r},nt=e=>{let t=0,n=0,r=``;for(let i=0;i<e.length;i++)for(n=n<<8|e[i],t+=8;t>=5;)r+=X[n>>>t-5&31],t-=5;return t>0&&(r+=X[n<<5-t&31]),r},rt=`0123456789ABCDEF`,it=e=>{e=e.replace(/ /g,``).toUpperCase();let t=new ArrayBuffer(e.length/2),n=new Uint8Array(t);for(let t=0;t<e.length;t+=2){let r=rt.indexOf(e[t]),i=rt.indexOf(e[t+1]);if(r===-1||i===-1)throw TypeError(`Invalid character found: ${e.substring(t,t+2)}`);n[t/2]=r<<4|i}return n},at=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length===1&&(t+=`0`),t+=r}return t.toUpperCase()},ot=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t)&255;return n},st=e=>{let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},ct=J.TextEncoder?new J.TextEncoder:null,lt=J.TextDecoder?new J.TextDecoder:null,ut=e=>{if(!ct)throw Error(`Encoding API not available`);return ct.encode(e)},dt=e=>{if(!lt)throw Error(`Encoding API not available`);return lt.decode(e)},ft=e=>{if(J.crypto?.getRandomValues)return J.crypto.getRandomValues(new Uint8Array(e));throw Error(`Cryptography API not available`)},Z=class e{static fromLatin1(t){return new e({buffer:ot(t).buffer})}static fromUTF8(t){return new e({buffer:ut(t).buffer})}static fromBase32(t){return new e({buffer:tt(t).buffer})}static fromHex(t){return new e({buffer:it(t).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:st(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:dt(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:nt(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:at(this.bytes)}),this.hex}constructor({buffer:e,size:t=20}={}){this.bytes=e===void 0?ft(t):new Uint8Array(e),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}},pt=(e,t)=>{{if(e.length!==t.length)throw TypeError(`Input strings must have the same length`);let n=-1,r=0;for(;++n<e.length;)r|=e.charCodeAt(n)^t.charCodeAt(n);return r===0}},Q=class e{static get defaults(){return{issuer:``,label:`OTPAuth`,issuerInLabel:!0,algorithm:`SHA1`,digits:6,counter:0,window:1}}static generate({secret:t,algorithm:r=e.defaults.algorithm,digits:i=e.defaults.digits,counter:a=e.defaults.counter,hmac:o=et}){let s=n(a),c=o(r,t.bytes,s);if(!c?.byteLength||c.byteLength<19)throw TypeError(`Return value must be at least 19 bytes`);let l=c[c.byteLength-1]&15;return(((c[l]&127)<<24|(c[l+1]&255)<<16|(c[l+2]&255)<<8|c[l+3]&255)%10**i).toString().padStart(i,`0`)}generate({counter:t=this.counter++}={}){return e.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:t,hmac:this.hmac})}static validate({token:t,secret:n,algorithm:r,digits:i=e.defaults.digits,counter:a=e.defaults.counter,window:o=e.defaults.window,hmac:s=et}){if(t.length!==i)return null;let c=null,l=o=>{pt(t,e.generate({secret:n,algorithm:r,digits:i,counter:o,hmac:s}))&&(c=o-a)};l(a);for(let e=1;e<=o&&c===null&&(l(a-e),!(c!==null||(l(a+e),c!==null)));++e);return c}validate({token:t,counter:n=this.counter,window:r}){return e.validate({token:t,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:n,window:r,hmac:this.hmac})}toString(){let e=encodeURIComponent;return`otpauth://hotp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&counter=${e(this.counter)}`}constructor({issuer:t=e.defaults.issuer,label:n=e.defaults.label,issuerInLabel:r=e.defaults.issuerInLabel,secret:i=new Z,algorithm:a=e.defaults.algorithm,digits:o=e.defaults.digits,counter:s=e.defaults.counter,hmac:c}={}){this.issuer=t,this.label=n,this.issuerInLabel=r,this.secret=typeof i==`string`?Z.fromBase32(i):i,this.algorithm=c?a:Y(a),this.digits=o,this.counter=s,this.hmac=c}},$=class e{static get defaults(){return{issuer:``,label:`OTPAuth`,issuerInLabel:!0,algorithm:`SHA1`,digits:6,period:30,window:1}}static counter({period:t=e.defaults.period,timestamp:n=Date.now()}={}){return Math.floor(n/1e3/t)}counter({timestamp:t=Date.now()}={}){return e.counter({period:this.period,timestamp:t})}static remaining({period:t=e.defaults.period,timestamp:n=Date.now()}={}){return t*1e3-n%(t*1e3)}remaining({timestamp:t=Date.now()}={}){return e.remaining({period:this.period,timestamp:t})}static generate({secret:t,algorithm:n,digits:r,period:i=e.defaults.period,timestamp:a=Date.now(),hmac:o}){return Q.generate({secret:t,algorithm:n,digits:r,counter:e.counter({period:i,timestamp:a}),hmac:o})}generate({timestamp:t=Date.now()}={}){return e.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:t,hmac:this.hmac})}static validate({token:t,secret:n,algorithm:r,digits:i,period:a=e.defaults.period,timestamp:o=Date.now(),window:s,hmac:c}){return Q.validate({token:t,secret:n,algorithm:r,digits:i,counter:e.counter({period:a,timestamp:o}),window:s,hmac:c})}validate({token:t,timestamp:n,window:r}){return e.validate({token:t,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:n,window:r,hmac:this.hmac})}toString(){let e=encodeURIComponent;return`otpauth://totp/${this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`}secret=${e(this.secret.base32)}&algorithm=${e(this.algorithm)}&digits=${e(this.digits)}&period=${e(this.period)}`}constructor({issuer:t=e.defaults.issuer,label:n=e.defaults.label,issuerInLabel:r=e.defaults.issuerInLabel,secret:i=new Z,algorithm:a=e.defaults.algorithm,digits:o=e.defaults.digits,period:s=e.defaults.period,hmac:c}={}){this.issuer=t,this.label=n,this.issuerInLabel=r,this.secret=typeof i==`string`?Z.fromBase32(i):i,this.algorithm=c?a:Y(a),this.digits=o,this.period=s,this.hmac=c}},mt=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,ht=/^[2-7A-Z]+=*$/i,gt=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,_t=/^[A-Z0-9]+(?:[_-][A-Z0-9]+)*$/i,vt=/^[+-]?\d+$/,yt=/^\+?[1-9]\d*$/,bt=class{static parse(e,{hmac:t}={}){let n;try{n=e.match(mt)}catch{}if(!Array.isArray(n))throw URIError(`Invalid URI format`);let r=n[1].toLowerCase(),i=n[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),a=n[3].split(`&`).reduce((e,t)=>{let n=t.split(/=(.*)/,2).map(decodeURIComponent),r=n[0].toLowerCase(),i=n[1],a=e;return a[r]=i,a},{}),o,s={};if(r===`hotp`){if(o=Q,a.counter!==void 0&&vt.test(a.counter))s.counter=parseInt(a.counter,10);else throw TypeError(`Missing or invalid 'counter' parameter`)}else if(r===`totp`){if(o=$,a.period!==void 0){if(yt.test(a.period))s.period=parseInt(a.period,10);else throw TypeError(`Invalid 'period' parameter`)}}else throw TypeError(`Unknown OTP type`);if(a.issuer!==void 0&&(s.issuer=a.issuer),i.length===2?(s.label=i[1],s.issuer===void 0||s.issuer===``?s.issuer=i[0]:i[0]===``&&(s.issuerInLabel=!1)):(s.label=i[0],s.issuer!==void 0&&s.issuer!==``&&(s.issuerInLabel=!1)),a.secret!==void 0&&ht.test(a.secret))s.secret=a.secret;else throw TypeError(`Missing or invalid 'secret' parameter`);if(a.algorithm!==void 0){if((t?_t:gt).test(a.algorithm))s.algorithm=a.algorithm;else throw TypeError(`Invalid 'algorithm' parameter`)}if(a.digits!==void 0){if(yt.test(a.digits))s.digits=parseInt(a.digits,10);else throw TypeError(`Invalid 'digits' parameter`)}return t!==void 0&&(s.hmac=t),new o(s)}static stringify(e){if(e instanceof Q||e instanceof $)return e.toString();throw TypeError(`Invalid 'HOTP/TOTP' object`)}};function xt(e,t){let n=e.trim();if(!n)return{kind:`empty`};try{let e=n.toLowerCase().startsWith(`otpauth://`)?bt.parse(n):new $({secret:Z.fromBase32(n.replace(/[\s-]+/g,``).toUpperCase())});if(!(e instanceof $))return{kind:`invalid`,message:`Only time-based codes are supported.`};let r=e.generate({timestamp:t}),i=Math.ceil(r.length/2);return{kind:`code`,code:`${r.slice(0,i)} ${r.slice(i)}`,remaining:e.period-Math.floor(t/1e3)%e.period,period:e.period}}catch{return{kind:`invalid`,message:`This is not a valid secret or otpauth link.`}}}function St(e,t){let n=e.trim();if(n)try{return n.toLowerCase().startsWith(`otpauth://`)?bt.parse(n)instanceof $?n:void 0:new $({issuer:`BrAIan`,label:t,secret:Z.fromBase32(n.replace(/[\s-]+/g,``).toUpperCase())}).toString()}catch{return}}function Ct(e,t,n){if(e===`otp`){let e=St(t,n??`Safe block`);return e?{content:e,caption:`Scan with an authenticator app to add this code.`}:void 0}return t?{content:t}:void 0}var wt=t(),Tt={pwd:`Password`,otp:`One-time password`};function Et({kind:t,text:n,title:r,open:i,onOpenChange:a}){let o=Ct(t,n,r);return o?(0,wt.jsx)(e,{content:o.content,caption:o.caption,title:r??(t?Tt[t]:`Safe block`),open:i,onOpenChange:a}):null}export{Ct as n,xt as r,Et as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{t as r}from"./TextAa.es-CymAJ91v.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{t as r}from"./TextAa.es-CymAJ91v.js";import{In as i,it as a,vr as o}from"./index-BVDhmwI8.js";import{nl as s,qc as c}from"./logic-DtHJ5GlU.js";import{i as l}from"./markdown-task-toggle-9k1EldDD.js";import{n as u,r as d,t as f}from"./safe-block-copy-BOVhmncw.js";import{t as p}from"./safe-block-qr-button-CD7cJG3N.js";var m=e(t(),1),h=n();function g({source:e}){let t=a(),n=i(),[g,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)({kind:`locked`}),S=s(e)[0],C=async e=>{if(!S?.header)x({kind:`damaged`,message:`This safe block cannot be opened: it is not complete.`});else if(!e)x({kind:`locked`});else{x({kind:`opening`});try{let n=await t.keyring.resolve(e,S.header.key);if(!n)throw Error(`This block's key is not in the vault.`);x({kind:`open`,text:await c(n,S)})}catch(e){x({kind:`damaged`,message:e instanceof Error?e.message:String(e)})}}};(0,m.useEffect)(()=>{C(t.currentKey())},[e,t.keyVersion]);let w=e=>void navigator.clipboard.writeText(e).then(()=>n.success(`Copied.`),()=>n.error(`This browser did not allow copying to the clipboard.`)),T=S?.header?.kind,E=T===`pwd`?`masked`:S?.header?.display??t.settings.blockDisplay,D=T===`pwd`?(0,h.jsx)(o,{size:`compact`,variant:`ghost`,"aria-label":`Reveal in large type`,title:`Reveal in large type`,onClick:()=>_(!0),children:(0,h.jsx)(r,{"aria-hidden":`true`})}):void 0,O=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p,{kind:T,text:b.text??``,title:S?.header?.title,open:v,onOpenChange:y}),D]});return(0,h.jsxs)(h.Fragment,{children:[g&&b.kind===`open`&&(0,h.jsx)(d,{title:S?.header?.title??`Password`,text:b.text??``,onClose:()=>_(!1)}),(0,h.jsx)(l,{state:b.kind,text:b.text,message:b.message,title:S?.header?.title,display:E,body:T===`otp`&&b.kind===`open`?(0,h.jsx)(u,{secret:b.text??``,onCopy:w}):void 0,onUnlock:async()=>{let e=await t.requestKey({reason:`This note holds a safe block.`});return e?(await C(e),!0):!1},actions:O,onCopy:e=>{let t=f(T,e,Date.now());t!==void 0&&w(t)}})]})}export{g as SafeBlockReader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Jc as e,Kc as t,Qc as n,ac as r,ec as i,il as a}from"./logic-DtHJ5GlU.js";import{r as o}from"./safe-folders-DmvM6dtV.js";function s(e,t){return e.filter(e=>o(e,t))}async function c(n,r,i){let o=a(n);return r===`encrypt`?o?void 0:e(i,n):o?t(i,n):void 0}function l(e){let t=e instanceof Error?e.message:String(e);return/live session/i.test(t)?`It is open in an editor. Close it and try again.`:t}async function u(e,t,a,o,s,u=4,d){let f={done:0,total:t.length,converted:0,skipped:0},p=[],m=t.some(e=>e.direction===`encrypt`)?await o.mintMany(a,t.filter(e=>e.direction===`encrypt`).length):[],h=0,g=0;async function _(){for(let u=h++;u<t.length;u=h++){let h=t[u];try{let t=await i(h.noteId,e),s=n(t.body),l=s?await o.resolve(a,s):h.direction===`encrypt`?m[g++]:void 0;if(!l)throw Error(s?`Its key '${s}' is not in the vault.`:`It is not a safe note.`);let u=await c(t.body,h.direction,l);if(u===void 0)f.skipped+=1;else{let n=await r(h.noteId,{vault:e,frontmatterSource:t.frontmatterSource,body:u,revision:t.revision});f.converted+=1,h.direction===`encrypt`?await d?.(h.noteId,t.body,n.revision).catch(()=>void 0):await o.drop(l.id).catch(()=>void 0)}}catch(e){p.push({noteId:h.noteId,message:l(e)})}f.done+=1,s({...f})}}return s({...f}),await Promise.all(Array.from({length:Math.min(u,t.length)},_)),{...f,failures:p}}export{u as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ll as e}from"./logic-DtHJ5GlU.js";function t(t){let n=t.trim().replace(/\/+/g,`/`).replace(/^\/|\/$/g,``);if(!n||n.includes(`\\`)||n.split(`/`).some(e=>!e.trim()||e===`.`||e===`..`||e.startsWith(`.`)))throw new e(`invalid_safe_folders`,`'${t}' is not a folder of the vault.`);return n}function n(e,t){return t===e||t.startsWith(`${e}/`)}function r(e,t=[]){return[...t??[]].filter(t=>e.startsWith(`${t.path}/`)).sort((e,t)=>t.path.length-e.path.length)[0]}function i(r,i,a){let o=t(i),s=r.find(e=>n(e.path,o));if(s)throw new e(`invalid_safe_folders`,s.path===o?`'${o}' is already encrypted.`:`'${o}' is inside '${s.path}', which is already encrypted.`);return[...r,{path:o,...a?{journalId:a}:{}}]}function a(e,t){return e.filter(e=>e.path!==t)}function o(e,t){return{added:t.filter(t=>!e.some(e=>e.path===t.path)),removed:e.filter(e=>!t.some(t=>t.path===e.path))}}export{a as i,o as n,r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gn as e,Kn as t,sr as n}from"./index-BVDhmwI8.js";import{t as r}from"./react-B3NTyEzE.js";var i=r();function a({count:r,onChoose:a,onCancel:o}){let s=r>1;return(0,i.jsx)(e,{mobilePresentation:`sheet`,title:s?`Decrypt ${r} notes while moving?`:`Decrypt the note while moving?`,description:s?`They are leaving a folder whose notes are encrypted.`:`It is leaving a folder whose notes are encrypted.`,onCancel:o,actions:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{onClick:o,children:`Cancel`}),(0,i.jsx)(t,{onClick:()=>a(`leave`),children:`Leave encrypted`}),(0,i.jsx)(t,{primary:!0,onClick:()=>a(`decrypt`),children:`Decrypt`})]}),children:(0,i.jsxs)(n,{as:`p`,children:[`Decrypting writes `,s?`each note`:`the note`,` as plain text, readable by search and the agent. Leaving `,s?`them`:`it`,` encrypted keeps `,s?`each one`:`it`,` a safe note you can decrypt later from its menu.`]})})}export{a as SafeMoveLeavingPopup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./LockSimple.es-DiQO6y_F.js";import{
|
|
1
|
+
import{t as e}from"./LockSimple.es-DiQO6y_F.js";import{_r as t,or as n,sr as r}from"./index-BVDhmwI8.js";import{t as i}from"./react-B3NTyEzE.js";var a=i();function o({error:i,onUnlock:o}){return(0,a.jsxs)(`div`,{className:`safe-note-locked`,role:`group`,"aria-label":`Locked safe note`,children:[(0,a.jsx)(e,{className:`safe-note-locked-icon`,"aria-hidden":`true`}),(0,a.jsx)(n,{as:`h3`,size:`subsection`,children:`This note is encrypted`}),(0,a.jsx)(r,{as:`p`,tone:i?`danger`:`muted`,children:i??`Its body opens on this device with the vault PIN or password. Its properties and links stay readable.`}),(0,a.jsx)(t,{variant:`primary`,"data-popup-autofocus":`true`,onClick:o,children:`Unlock`})]})}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{Hc as r,aa as i,mc as a,oa as o,td as s,va as c,zc as l}from"./logic-BNk_20eJ.js";import{a as u,c as d,n as f,o as p,u as m}from"./settings-ChT117Ke.js";import{Bn as h,Jt as g,Pn as _,ar as v,hr as y,it as b,pr as x,rr as S}from"./index-CCUyKE6q.js";import{n as C,t as w}from"./secret-popup-y9W7WIrZ.js";import{i as T,n as E,r as D,t as O}from"./safe-folders-DCf8IdrM.js";import{t as k}from"./folder-picker-dialog-D57Q15N4.js";import{t as A}from"./use-safe-folders-apply-C9pni8YW.js";function j(e,t){let{added:n,removed:r}=E(e,t),i=new Set(r.map(e=>e.path));return[...e.map(e=>({folder:e,state:i.has(e.path)?`removed`:`saved`})),...n.map(e=>({folder:e,state:`added`}))]}function M(e,t){let{added:n,removed:r}=E(e,t);return n.length>0||r.length>0}var N=e(t(),1),P=n();function F(){let e=b(),t=_(),{apply:n,busy:r,dialog:i}=A(),a=e.settings.folders,[o,c]=(0,N.useState)(a),[l,m]=(0,N.useState)(),h=M(a,o),g=JSON.stringify(a);(0,N.useEffect)(()=>{c(e=>M(JSON.parse(g),e)?e:JSON.parse(g))},[g]);function x(e){try{c(O(o,e)),m(void 0)}catch(e){t.error(s(e))}}function S(e,t){c(t===`removed`?[...o,e]:T(o,e.path))}async function C(e){e.preventDefault(),await n(o)}let w=j(a,o);return(0,P.jsxs)(u,{onSubmit:e=>void C(e),children:[(0,P.jsx)(d,{label:`Encrypt all notes in folders`,persistence:`explicit`,layout:`control`,description:`Every Markdown note in these folders, and below, is encrypted when you save the selection, and whenever it is saved from the editor afterwards. This only affects the Markdown content of the notes, not files or attachments they reference, nor a note's title and properties.`,children:(0,P.jsx)(y,{type:`button`,disabled:r,onClick:()=>m(``),children:`Add folder…`})}),(w.length>0||h)&&(0,P.jsxs)(f,{className:`safe-folders`,children:[w.length>0&&(0,P.jsx)(`ul`,{className:`safe-folders-list`,"aria-label":`Safe folders`,children:w.map(({folder:e,state:t})=>(0,P.jsxs)(`li`,{className:`safe-folders-row`,"data-state":t,children:[(0,P.jsx)(v,{className:`safe-folders-row-path`,truncate:!0,monospace:!0,children:e.path}),e.journalId&&(0,P.jsxs)(v,{size:`caption`,tone:`muted`,children:[`Journal `,e.journalId]}),t===`added`&&(0,P.jsx)(v,{size:`caption`,tone:`success`,children:`Will be encrypted`}),t===`removed`&&(0,P.jsx)(v,{size:`caption`,tone:`warning`,children:`Will stop`}),(0,P.jsx)(y,{variant:`link-neutral`,type:`button`,disabled:r,"aria-label":`${t===`removed`?`Keep`:`Remove`} ${e.path}`,onClick:()=>S(e,t),children:t===`removed`?`Keep`:`Remove`})]},e.path))}),(0,P.jsx)(p,{dirty:h,busy:r,saveLabel:`Save folder selection`,savingLabel:`Saving…`,onCancel:()=>c(a)})]}),l!==void 0&&e.vaultId&&(0,P.jsx)(k,{vaultId:e.vaultId,title:`Encrypt a folder`,description:`Its notes are encrypted when you save the selection.`,confirmLabel:`Add folder`,path:l,isDisabled:e=>!e||!!D(`${e}/x`,o),onPathChange:m,onCancel:()=>m(void 0),onConfirm:()=>x(l)}),i]})}var I=[`Safe notes and safe blocks stay encrypted. Nothing is decrypted and no key is deleted.`,`The PIN still opens them, and an open safe note or block can still be edited: it saves encrypted.`,`Nothing new can be encrypted: Encrypt note, /safe, /pwd, /otp, Make safe and safe folders stop, and so do Decrypt note and Make plain.`,`The server forgets the copies and keys it holds for share links, and shared safe text answers locked until Safe Notes is on again.`];function L(){let e=g(),t=_(),n=h(),[r,i]=(0,N.useState)(!1),a=e.settings.safeNotes?.enabled??!1;return{label:`Enable Safe Notes`,description:a?`Encrypt a note, or blocks inside a note, on this device with a vault PIN or password. Turned off, existing safe notes stay readable and editable with the PIN, and nothing new is encrypted.`:(0,P.jsxs)(P.Fragment,{children:[`Read mode. `,I.join(` `)]}),checked:a,disabled:e.loading||r,onCheckedChange:r=>void(async()=>{if(r||await n.confirm({title:`Turn Safe Notes off?`,message:`Safe notes switch to read mode.`,confirmLabel:`Turn off`,detail:(0,P.jsx)(P.Fragment,{children:I.map(e=>(0,P.jsx)(v,{as:`p`,children:e},e))})})){i(!0);try{await e.update({op:`set_safe_notes_enabled`,enabled:r})}catch(e){t.error(s(e))}finally{i(!1)}}})()}}function R(){let e=g(),t=_(),n={...a,...e.settings.safeNotes};return{current:n,loading:e.loading,update:async r=>{let i={sharing:n.sharing,plainExport:n.plainExport,blockDisplay:n.blockDisplay,...r};try{return await e.update({op:`replace_safe_notes`,safeNotes:i}),!0}catch(e){return t.error(s(e)),!1}}}}function z(){let e=b(),t=_(),[n,i]=(0,N.useState)(),[a,o]=(0,N.useState)(),[c,u]=(0,N.useState)(!1),[f,p]=(0,N.useState)(),m=e.keyDocument,h=m?.keyFile;async function g(n,r){u(!0),p(void 0);try{h&&(await e.saveKeyFile(await l(h,r,n),m?.revision??null,r),i(void 0),t.success(`${n.kind===`pin`?`PIN`:`Password`} changed. No note was rewritten, and the recovery code still works.`))}catch(e){p(s(e))}finally{u(!1)}}let[v,x]=(0,N.useState)();async function S(){let t=await e.requestKey({force:!0,reason:`Enter the current one before choosing a new one.`});t&&(x(t),i(`change`))}async function T(){if(!h)return;let n=await e.requestKey({force:!0,reason:`A new recovery code retires the old one.`});if(n)try{let t=await r(h,n);await e.saveKeyFile(t.file,m?.revision??null),o(t.recoveryCode)}catch(e){t.error(s(e))}}return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(d,{label:`PIN or password`,description:h?`Unlocks the vault's safe notes with a ${h.secret.kind===`pin`?`${h.secret.length}-digit PIN`:`password`}. Changing it rewrites no note.`:`Each safe note gets a key of its own; the PIN or password unlocks them, on any device.`,persistence:`custom`,layout:`control`,children:h?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(y,{disabled:!m,onClick:()=>void S(),children:`Change PIN or password…`}),(0,P.jsx)(y,{onClick:()=>void T(),children:`Show a new recovery code…`})]}):(0,P.jsx)(y,{variant:`primary`,disabled:!m,onClick:()=>void e.requestSetup(),children:`Set up PIN or password…`})}),n&&(0,P.jsx)(w,{title:`Change PIN or password`,description:`The recovery code stays valid.`,initialKind:h?.secret.kind,initialLength:h?.secret.length,busy:c,error:f,onCancel:()=>{i(void 0),x(void 0)},onSubmit:e=>void g(e,v)}),a&&(0,P.jsx)(C,{code:a,onClose:()=>o(void 0)})]})}function B(){let e=b();return(0,P.jsx)(d,{label:`Auto lock`,description:`This device locks the vault after this long with no typing, clicking, scrolling or touch. Each device keeps its own choice.`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(m,{"aria-label":`Auto lock`,value:e.autoLock,onChange:t=>e.setAutoLock(t.target.value),children:i.map(e=>(0,P.jsx)(`option`,{value:e,children:o[e]},e))})})}function V(){let{current:e,loading:t,update:n}=R();return(0,P.jsx)(d,{label:`Unlocked safe blocks`,description:`Masked shows dots until you reveal a block; Copy works either way. Each block can override this from its own menu.`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(S,{label:`Unlocked safe blocks`,value:e.blockDisplay,disabled:t,options:[{value:`masked`,label:`Masked`},{value:`shown`,label:`Shown`}],onValueChange:e=>void n({blockDisplay:e})})})}function H(){let{current:e,loading:t,update:n}=R(),r=b();async function i(t){if(t!==e.sharing&&r.vaultId){if(t===`key`){if(!await n({sharing:`key`}))return;await r.requestKey({reason:`The server keeps the keys of shared notes in memory until it restarts.`})&&await r.syncSharedCopies()}else await n({sharing:`copy`})&&await c(r.vaultId,`keys`).catch(()=>void 0)}}let a=e.sharing===`copy`?`Keep a decrypted copy of each shared note: the server never knows a key, and safe text shares read-only. Your device sends the copy when you share and each time you save.`:`Keep the keys of shared notes on the server: edit links work on their safe text, and the running server can read those notes, and only those, until it restarts. The agent never can.`;return(0,P.jsx)(d,{label:`Sharing`,description:a,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(S,{label:`Sharing`,value:e.sharing,disabled:t,options:[{value:`copy`,label:`Decrypted copies`},{value:`key`,label:`Key on the server`}],onValueChange:e=>void i(e)})})}function U(){let{current:e,loading:t,update:n}=R();return(0,P.jsx)(d,{label:`Allow exporting a safe note`,description:`Export converts on the server, so the decrypted note crosses the wire and the server process once per export. Off, Export is absent for a safe note, and safe blocks export as [safe block].`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(x,{checked:e.plainExport,disabled:t,onCheckedChange:e=>void n({plainExport:e}),children:(0,P.jsx)(`span`,{className:`visually-hidden`,children:`Allow exporting a safe note`})})})}function W(){let e=b(),t=_();return(0,P.jsxs)(d,{label:`Forget`,description:`This device asks for the PIN again. The server forgets the note keys and the copies it holds, and shared safe text answers locked until you unlock it.`,persistence:`custom`,layout:`control`,children:[(0,P.jsx)(y,{onClick:()=>{e.forgetOnDevice(),t.success(`This device no longer keeps the key.`)},children:`Forget the key on this device`}),(0,P.jsx)(y,{disabled:!e.vaultId,onClick:()=>void c(e.vaultId).then(()=>t.success(`The server forgot the note keys and its copies.`),e=>t.error(s(e))),children:`Forget on the server`})]})}var G={sections:[{id:`safe-notes`,title:`Safe Notes`,priority:210,useToggle:L}],contributions:[{id:`safe-notes-key`,sectionId:`safe-notes`,priority:100,persistence:`custom`,Component:z},{id:`safe-notes-auto-lock`,sectionId:`safe-notes`,priority:120,persistence:`immediate`,Component:B},{id:`safe-notes-folders`,sectionId:`safe-notes`,priority:150,persistence:`explicit`,Component:F},{id:`safe-notes-blocks`,sectionId:`safe-notes`,priority:200,persistence:`immediate`,Component:V},{id:`safe-notes-sharing`,sectionId:`safe-notes`,priority:300,persistence:`immediate`,Component:H},{id:`safe-notes-export`,sectionId:`safe-notes`,priority:400,persistence:`immediate`,Component:U},{id:`safe-notes-forget`,sectionId:`safe-notes`,priority:500,persistence:`custom`,Component:W}]};export{G as safeNotesSettingsModule};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{Bc as r,Lc as i,ba as a,ca as o,gc as s,rd as c,sa as l}from"./logic-DtHJ5GlU.js";import{a as u,c as d,n as f,o as p,u as m}from"./settings-CU8YR8di.js";import{Hn as h,In as g,Jt as _,_r as v,ar as y,hr as b,it as x,sr as S}from"./index-BVDhmwI8.js";import{n as C,t as w}from"./secret-popup-CoVpeLZV.js";import{i as T,n as E,r as D,t as O}from"./safe-folders-DmvM6dtV.js";import{t as k}from"./folder-picker-dialog-D_VCqm_i.js";import{t as A}from"./use-safe-folders-apply-B1V8l7WU.js";function j(e,t){let{added:n,removed:r}=E(e,t),i=new Set(r.map(e=>e.path));return[...e.map(e=>({folder:e,state:i.has(e.path)?`removed`:`saved`})),...n.map(e=>({folder:e,state:`added`}))]}function M(e,t){let{added:n,removed:r}=E(e,t);return n.length>0||r.length>0}var N=e(t(),1),P=n();function F(){let e=x(),t=g(),{apply:n,busy:r,dialog:i}=A(),a=e.settings.folders,[o,s]=(0,N.useState)(a),[l,m]=(0,N.useState)(),h=M(a,o),_=JSON.stringify(a);(0,N.useEffect)(()=>{s(e=>M(JSON.parse(_),e)?e:JSON.parse(_))},[_]);function y(e){try{s(O(o,e)),m(void 0)}catch(e){t.error(c(e))}}function b(e,t){s(t===`removed`?[...o,e]:T(o,e.path))}async function C(e){e.preventDefault(),await n(o)}let w=j(a,o);return(0,P.jsxs)(u,{onSubmit:e=>void C(e),children:[(0,P.jsx)(d,{label:`Encrypt all notes in folders`,persistence:`explicit`,layout:`control`,description:`Every Markdown note in these folders, and below, is encrypted when you save the selection, and whenever it is saved from the editor afterwards. This only affects the Markdown content of the notes, not files or attachments they reference, nor a note's title and properties.`,children:(0,P.jsx)(v,{type:`button`,disabled:r,onClick:()=>m(``),children:`Add folder…`})}),(w.length>0||h)&&(0,P.jsxs)(f,{className:`safe-folders`,children:[w.length>0&&(0,P.jsx)(`ul`,{className:`safe-folders-list`,"aria-label":`Safe folders`,children:w.map(({folder:e,state:t})=>(0,P.jsxs)(`li`,{className:`safe-folders-row`,"data-state":t,children:[(0,P.jsx)(S,{className:`safe-folders-row-path`,truncate:!0,monospace:!0,children:e.path}),e.journalId&&(0,P.jsxs)(S,{size:`caption`,tone:`muted`,children:[`Journal `,e.journalId]}),t===`added`&&(0,P.jsx)(S,{size:`caption`,tone:`success`,children:`Will be encrypted`}),t===`removed`&&(0,P.jsx)(S,{size:`caption`,tone:`warning`,children:`Will stop`}),(0,P.jsx)(v,{variant:`link-neutral`,type:`button`,disabled:r,"aria-label":`${t===`removed`?`Keep`:`Remove`} ${e.path}`,onClick:()=>b(e,t),children:t===`removed`?`Keep`:`Remove`})]},e.path))}),(0,P.jsx)(p,{dirty:h,busy:r,saveLabel:`Save folder selection`,savingLabel:`Saving…`,onCancel:()=>s(a)})]}),l!==void 0&&e.vaultId&&(0,P.jsx)(k,{vaultId:e.vaultId,title:`Encrypt a folder`,description:`Its notes are encrypted when you save the selection.`,confirmLabel:`Add folder`,path:l,isDisabled:e=>!e||!!D(`${e}/x`,o),onPathChange:m,onCancel:()=>m(void 0),onConfirm:()=>y(l)}),i]})}var I=[`Safe notes and safe blocks stay encrypted. Nothing is decrypted and no key is deleted.`,`The PIN still opens them, and an open safe note or block can still be edited: it saves encrypted.`,`Nothing new can be encrypted: Encrypt note, /safe, /pwd, /otp, Make safe and safe folders stop, and so do Decrypt note and Make plain.`,`The server forgets the copies and keys it holds for share links, and shared safe text answers locked until Safe Notes is on again.`];function L(){let e=_(),t=g(),n=h(),[r,i]=(0,N.useState)(!1),a=e.settings.safeNotes?.enabled??!1;return{label:`Enable Safe Notes`,description:a?`Encrypt a note, or blocks inside a note, on this device with a vault PIN or password. Turned off, existing safe notes stay readable and editable with the PIN, and nothing new is encrypted.`:(0,P.jsxs)(P.Fragment,{children:[`Read mode. `,I.join(` `)]}),checked:a,disabled:e.loading||r,onCheckedChange:r=>void(async()=>{if(r||await n.confirm({title:`Turn Safe Notes off?`,message:`Safe notes switch to read mode.`,confirmLabel:`Turn off`,detail:(0,P.jsx)(P.Fragment,{children:I.map(e=>(0,P.jsx)(S,{as:`p`,children:e},e))})})){i(!0);try{await e.update({op:`set_safe_notes_enabled`,enabled:r})}catch(e){t.error(c(e))}finally{i(!1)}}})()}}function R(){let e=_(),t=g(),n={...s,...e.settings.safeNotes};return{current:n,loading:e.loading,update:async r=>{let i={sharing:n.sharing,plainExport:n.plainExport,blockDisplay:n.blockDisplay,...r};try{return await e.update({op:`replace_safe_notes`,safeNotes:i}),!0}catch(e){return t.error(c(e)),!1}}}}function z(){let e=x(),t=g(),[n,a]=(0,N.useState)(),[o,s]=(0,N.useState)(),[l,u]=(0,N.useState)(!1),[f,p]=(0,N.useState)(),m=e.keyDocument,h=m?.keyFile;async function _(n,r){u(!0),p(void 0);try{h&&(await e.saveKeyFile(await i(h,r,n),m?.revision??null,r),a(void 0),t.success(`${n.kind===`pin`?`PIN`:`Password`} changed. No note was rewritten, and the recovery code still works.`))}catch(e){p(c(e))}finally{u(!1)}}let[y,b]=(0,N.useState)();async function S(){let t=await e.requestKey({force:!0,reason:`Enter the current one before choosing a new one.`});t&&(b(t),a(`change`))}async function T(){if(!h)return;let n=await e.requestKey({force:!0,reason:`A new recovery code retires the old one.`});if(n)try{let t=await r(h,n);await e.saveKeyFile(t.file,m?.revision??null),s(t.recoveryCode)}catch(e){t.error(c(e))}}return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(d,{label:`PIN or password`,description:h?`Unlocks the vault's safe notes with a ${h.secret.kind===`pin`?`${h.secret.length}-digit PIN`:`password`}. Changing it rewrites no note.`:`Each safe note gets a key of its own; the PIN or password unlocks them, on any device.`,persistence:`custom`,layout:`control`,children:h?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(v,{disabled:!m,onClick:()=>void S(),children:`Change PIN or password…`}),(0,P.jsx)(v,{onClick:()=>void T(),children:`Show a new recovery code…`})]}):(0,P.jsx)(v,{variant:`primary`,disabled:!m,onClick:()=>void e.requestSetup(),children:`Set up PIN or password…`})}),n&&(0,P.jsx)(w,{title:`Change PIN or password`,description:`The recovery code stays valid.`,initialKind:h?.secret.kind,initialLength:h?.secret.length,busy:l,error:f,onCancel:()=>{a(void 0),b(void 0)},onSubmit:e=>void _(e,y)}),o&&(0,P.jsx)(C,{code:o,onClose:()=>s(void 0)})]})}function B(){let e=x();return(0,P.jsx)(d,{label:`Auto lock`,description:`This device locks the vault after this long with no typing, clicking, scrolling or touch. Each device keeps its own choice.`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(m,{"aria-label":`Auto lock`,value:e.autoLock,onChange:t=>e.setAutoLock(t.target.value),children:l.map(e=>(0,P.jsx)(`option`,{value:e,children:o[e]},e))})})}function V(){let{current:e,loading:t,update:n}=R();return(0,P.jsx)(d,{label:`Unlocked safe blocks`,description:`Masked shows dots until you reveal a block; Copy works either way. Each block can override this from its own menu.`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(y,{label:`Unlocked safe blocks`,value:e.blockDisplay,disabled:t,options:[{value:`masked`,label:`Masked`},{value:`shown`,label:`Shown`}],onValueChange:e=>void n({blockDisplay:e})})})}function H(){let{current:e,loading:t,update:n}=R(),r=x();async function i(t){if(t!==e.sharing&&r.vaultId){if(t===`key`){if(!await n({sharing:`key`}))return;await r.requestKey({reason:`The server keeps the keys of shared notes in memory until it restarts.`})&&await r.syncSharedCopies()}else await n({sharing:`copy`})&&await a(r.vaultId,`keys`).catch(()=>void 0)}}let o=e.sharing===`copy`?`Keep a decrypted copy of each shared note: the server never knows a key, and safe text shares read-only. Your device sends the copy when you share and each time you save.`:`Keep the keys of shared notes on the server: edit links work on their safe text, and the running server can read those notes, and only those, until it restarts. The agent never can.`;return(0,P.jsx)(d,{label:`Sharing`,description:o,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(y,{label:`Sharing`,value:e.sharing,disabled:t,options:[{value:`copy`,label:`Decrypted copies`},{value:`key`,label:`Key on the server`}],onValueChange:e=>void i(e)})})}function U(){let{current:e,loading:t,update:n}=R();return(0,P.jsx)(d,{label:`Allow exporting a safe note`,description:`Export converts on the server, so the decrypted note crosses the wire and the server process once per export. Off, Export is absent for a safe note, and safe blocks export as [safe block].`,persistence:`immediate`,layout:`control`,children:(0,P.jsx)(b,{checked:e.plainExport,disabled:t,onCheckedChange:e=>void n({plainExport:e}),children:(0,P.jsx)(`span`,{className:`visually-hidden`,children:`Allow exporting a safe note`})})})}function W(){let e=x(),t=g();return(0,P.jsxs)(d,{label:`Forget`,description:`This device asks for the PIN again. The server forgets the note keys and the copies it holds, and shared safe text answers locked until you unlock it.`,persistence:`custom`,layout:`control`,children:[(0,P.jsx)(v,{onClick:()=>{e.forgetOnDevice(),t.success(`This device no longer keeps the key.`)},children:`Forget the key on this device`}),(0,P.jsx)(v,{disabled:!e.vaultId,onClick:()=>void a(e.vaultId).then(()=>t.success(`The server forgot the note keys and its copies.`),e=>t.error(c(e))),children:`Forget on the server`})]})}var G={sections:[{id:`safe-notes`,title:`Safe Notes`,priority:210,useToggle:L}],contributions:[{id:`safe-notes-key`,sectionId:`safe-notes`,priority:100,persistence:`custom`,Component:z},{id:`safe-notes-auto-lock`,sectionId:`safe-notes`,priority:120,persistence:`immediate`,Component:B},{id:`safe-notes-folders`,sectionId:`safe-notes`,priority:150,persistence:`explicit`,Component:F},{id:`safe-notes-blocks`,sectionId:`safe-notes`,priority:200,persistence:`immediate`,Component:V},{id:`safe-notes-sharing`,sectionId:`safe-notes`,priority:300,persistence:`immediate`,Component:H},{id:`safe-notes-export`,sectionId:`safe-notes`,priority:400,persistence:`immediate`,Component:U},{id:`safe-notes-forget`,sectionId:`safe-notes`,priority:500,persistence:`custom`,Component:W}]};export{G as safeNotesSettingsModule};
|