ocean-brain 0.8.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/mcp.js +103 -105
- package/package.json +3 -2
- package/server/client/dist/assets/{ArrowRight.es-g2YZTklZ.js → ArrowRight.es-BEhnlwfe.js} +1 -1
- package/server/client/dist/assets/AuxiliaryPanelHeader-B1k7pZpn.js +1 -0
- package/server/client/dist/assets/Calendar-D7QJsAlg.js +25 -0
- package/server/client/dist/assets/{Callout-B_IPSF_5.js → Callout-BTd1BYtV.js} +1 -1
- package/server/client/dist/assets/{Copy.es-CNxe4ujr.js → Copy.es-BoLjilxv.js} +1 -1
- package/server/client/dist/assets/File.es-Ct7fscBg.js +1 -0
- package/server/client/dist/assets/Graph-DYUb7gQb.js +46 -0
- package/server/client/dist/assets/{Graph-D9GeO71k.js → Graph-LY_IgMYy.js} +1 -1
- package/server/client/dist/assets/{Image.es-DnON8cv2.js → Image.es-OYyN3BYt.js} +1 -1
- package/server/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/server/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/server/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/server/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/server/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/server/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/server/client/dist/assets/Note-DsMhwrHw.js +25 -0
- package/server/client/dist/assets/NotePropertiesPanel-aCKXAe5F.js +2 -0
- package/server/client/dist/assets/PencilLine.es-0JpEgxFY.js +1 -0
- package/server/client/dist/assets/{Plus.es-CQ8wn2is.js → Plus.es-DRfLW_bI.js} +1 -1
- package/server/client/dist/assets/Reminders-COr1OHvF.js +1 -0
- package/server/client/dist/assets/Search-Ctkx0BQk.js +31 -0
- package/server/client/dist/assets/SurfaceCard-t7pdfhEe.js +1 -0
- package/server/client/dist/assets/Tag-BjxtrIQW.js +1 -0
- package/server/client/dist/assets/TagNotes-DV_fdRbg.js +1 -0
- package/server/client/dist/assets/{Trash.es-0aPpA-3S.js → Trash.es-Bo1VyK9Q.js} +1 -1
- package/server/client/dist/assets/ViewChip-DlCkL4z4.js +1 -0
- package/server/client/dist/assets/ViewNotes-wWWeFJyU.js +1 -0
- package/server/client/dist/assets/ViewSectionDialog-DhH8harC.js +102 -0
- package/server/client/dist/assets/Views-CWE99SnI.js +1 -0
- package/server/client/dist/assets/abnfDiagram-VRR7QNED-CWlV5dXw.js +1 -0
- package/server/client/dist/assets/app-B9WZRrAH.css +1 -0
- package/server/client/dist/assets/app-BpSMjzET.js +26 -0
- package/server/client/dist/assets/arc-BV-n6RUX.js +1 -0
- package/server/client/dist/assets/architectureDiagram-ZJ3FMSHR-CekzMXdu.js +36 -0
- package/server/client/dist/assets/blockDiagram-677ZJIJ3-B49yHoxq.js +132 -0
- package/server/client/dist/assets/c4Diagram-LMCZKHZV-0AfB9NBC.js +10 -0
- package/server/client/dist/assets/channel-CigOulR-.js +1 -0
- package/server/client/dist/assets/chunk-2Q5K7J3B-DaPQAU1q.js +1 -0
- package/server/client/dist/assets/chunk-32BRIVSS-CfL3kZAg.js +1 -0
- package/server/client/dist/assets/chunk-5VM5RSS4-DeOwWPE_.js +15 -0
- package/server/client/dist/assets/chunk-EX3LRPZG-C3W1oc9y.js +231 -0
- package/server/client/dist/assets/chunk-JWPE2WC7-_Oqh79OY.js +1 -0
- package/server/client/dist/assets/chunk-MOJQB5TN-DDKNNzI6.js +88 -0
- package/server/client/dist/assets/chunk-RYQCIY6F-DCHah7CC.js +1 -0
- package/server/client/dist/assets/chunk-V7JOEXUC-uUOIzgxj.js +206 -0
- package/server/client/dist/assets/chunk-VR4S4FIN-DDVw2WPs.js +1 -0
- package/server/client/dist/assets/chunk-XXDRQBXY-Coo4UFm2.js +1 -0
- package/server/client/dist/assets/classDiagram-OUVF2IWQ-D13ISIOW.js +1 -0
- package/server/client/dist/assets/classDiagram-v2-EOCWNBFH-D13ISIOW.js +1 -0
- package/server/client/dist/assets/colors-Cc3OSVma.js +1 -0
- package/server/client/dist/assets/cose-bilkent-JH36ORCC-C3pHmHpD.js +1 -0
- package/server/client/dist/assets/cynefin-VYW2F7L2-DU_G4Atc.js +166 -0
- package/server/client/dist/assets/cynefinDiagram-TSTJHNR4-DZ6iiJFo.js +62 -0
- package/server/client/dist/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
- package/server/client/dist/assets/dagre-VKFMJZFB-DNELbhwC.js +4 -0
- package/server/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/server/client/dist/assets/diagram-FQU43EPY-CMEvZJ61.js +3 -0
- package/server/client/dist/assets/diagram-G47NLZAW-BYDtf6j9.js +24 -0
- package/server/client/dist/assets/diagram-NH7WQ7WH-CmXfcCQA.js +24 -0
- package/server/client/dist/assets/diagram-OA4YK3LP-BflTKJxU.js +30 -0
- package/server/client/dist/assets/diagram-WEI45ONY-KW3fKqna.js +41 -0
- package/server/client/dist/assets/ebnfDiagram-CCIWWBDH-CbyhY5Nj.js +1 -0
- package/server/client/dist/assets/erDiagram-Q63AITRT-CC2eZV8g.js +85 -0
- package/server/client/dist/assets/{floating-ui.react-dom-wWLZ1CdM.js → floating-ui.react-dom-BWTnA00G.js} +1 -1
- package/server/client/dist/assets/flowDiagram-23GEKE2U-unplo7Qm.js +156 -0
- package/server/client/dist/assets/ganttDiagram-NO4QXBWP-BcBK5HcZ.js +292 -0
- package/server/client/dist/assets/gitGraphDiagram-IHSO6WYX-DgVbbb5k.js +106 -0
- package/server/client/dist/assets/graph-C5DFNLrC.js +1 -0
- package/server/client/dist/assets/image-delete-confirmation-D7xrODQV.js +1 -0
- package/server/client/dist/assets/image.api-CyQisInP.js +17 -0
- package/server/client/dist/assets/index-B-E1Ilh9.js +1 -0
- package/server/client/dist/assets/infoDiagram-FWYZ7A6U-N_D9RdfG.js +2 -0
- package/server/client/dist/assets/init-Gi6I4Gst.js +1 -0
- package/server/client/dist/assets/isObject-U9U2HXiq.js +1 -0
- package/server/client/dist/assets/ishikawaDiagram-FXEZZL3T-BBKrzmB2.js +70 -0
- package/server/client/dist/assets/journeyDiagram-5HDEW3XC-NdCxLmQB.js +139 -0
- package/server/client/dist/assets/kanban-definition-HUTT4EX6-Ck7t4-tt.js +89 -0
- package/server/client/dist/assets/katex-DywYRkvg.css +1 -0
- package/server/client/dist/assets/katex-HP8lGamR.js +257 -0
- package/server/client/dist/assets/katex-x288kqHd.js +257 -0
- package/server/client/dist/assets/layout-Cz0MDlGi.js +1 -0
- package/server/client/dist/assets/linear-D6yRgDLq.js +1 -0
- package/server/client/dist/assets/manage-image-azmo5iVw.js +1 -0
- package/server/client/dist/assets/manage-image-detail-BF-uSqb_.js +1 -0
- package/server/client/dist/assets/map-Mm1V-_Na.js +1 -0
- package/server/client/dist/assets/{mcp-CT_9IV2c.js → mcp-CCaFd0zm.js} +4 -4
- package/server/client/dist/assets/{mcp-admin-adapter-xAuyZc_M.js → mcp-admin-adapter-PMmgPupc.js} +1 -1
- package/server/client/dist/assets/mermaid.core-B14ZAmWA.js +308 -0
- package/server/client/dist/assets/min-tv6RD-6E.js +1 -0
- package/server/client/dist/assets/mindmap-definition-LN4V7U3C-BTUqSdcP.js +96 -0
- package/server/client/dist/assets/{note-core-Buwzyxi7.js → note-core-DUTqUh5N.js} +2 -2
- package/server/client/dist/assets/{note-runtime-CPDVOFEo.js → note-runtime-zN5ddTba.js} +1 -1
- package/server/client/dist/assets/{note-ui-CHI-tzj-.js → note-ui-CtijppHK.js} +1 -1
- package/server/client/dist/assets/{note.api-D_00ZzJC.js → note.api-D3oJmG3q.js} +6 -6
- package/server/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/server/client/dist/assets/pegDiagram-2B236MQR-Cjcu3mVz.js +1 -0
- package/server/client/dist/assets/pieDiagram-ENE6RG2P-BxI_c22Z.js +39 -0
- package/server/client/dist/assets/{placeholder-DbdGiYGL.js → placeholder-AusSo8p9.js} +4 -4
- package/server/client/dist/assets/properties-BrNJLkxR.js +1 -0
- package/server/client/dist/assets/quadrantDiagram-ABIIQ3AL-DGm0a-yR.js +7 -0
- package/server/client/dist/assets/railroadDiagram-RFXS5EU6-DmCDu89O.js +1 -0
- package/server/client/dist/assets/requirementDiagram-TGXJPOKE-CBpUt7Ig.js +84 -0
- package/server/client/dist/assets/route-preload.js +2 -2
- package/server/client/dist/assets/sankeyDiagram-HTMAVEWB-BjGnDZlp.js +40 -0
- package/server/client/dist/assets/search-D-xKTPdO.js +1 -0
- package/server/client/dist/assets/search-admin-adapter-CJnJmL6w.js +1 -0
- package/server/client/dist/assets/sequenceDiagram-DBY2YBRQ-B7rpCfS6.js +162 -0
- package/server/client/dist/assets/sizeCapture-X5ZJPWSS-CUJhD0uW.js +1 -0
- package/server/client/dist/assets/stateDiagram-2N3HPSRC-Y9-3XqRX.js +1 -0
- package/server/client/dist/assets/stateDiagram-v2-6OUMAXLB-DbHXhT02.js +1 -0
- package/server/client/dist/assets/swimlanes-5IMT3BWC-Cs1NO9ng.js +2 -0
- package/server/client/dist/assets/swimlanesDiagram-G3AALYLV-DQnrq2ZC.js +8 -0
- package/server/client/dist/assets/{tag.api-CX0SE06J.js → tag.api-DNSQpqwk.js} +3 -3
- package/server/client/dist/assets/time-D5LRMumI.js +9 -0
- package/server/client/dist/assets/timeline-definition-FHXFAJF6-8fqD4WNL.js +120 -0
- package/server/client/dist/assets/toNumber-DE3J3kMD.js +1 -0
- package/server/client/dist/assets/transform-BUB79_za.js +1 -0
- package/server/client/dist/assets/trash-D4-9sv8q.js +1 -0
- package/server/client/dist/assets/url-9nrbQs7Z.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-CLK1tHvT.js → useReminderMutate-BrGO9M0o.js} +4 -4
- package/server/client/dist/assets/vennDiagram-L72KCM5P-BPqKkd5a.js +34 -0
- package/server/client/dist/assets/wardleyDiagram-EHGQE667-Cq11kU2M.js +78 -0
- package/server/client/dist/assets/xychartDiagram-FW5EYKEG-DJ6UzFj-.js +7 -0
- package/server/client/dist/index.html +7 -7
- package/server/dist/features/image/services/delete.js +25 -1
- package/server/dist/features/note/graphql/note.field.resolver.js +2 -0
- package/server/dist/features/note/graphql/note.mutation.resolver.js +54 -23
- package/server/dist/features/note/graphql/note.query.resolver.js +15 -5
- package/server/dist/features/note/graphql/note.type-defs.js +2 -1
- package/server/dist/features/note/http/mcp.js +1 -60
- package/server/dist/features/note/services/authoring.js +17 -80
- package/server/dist/features/note/services/markdown-patch.js +80 -8
- package/server/dist/features/note/services/note-reference-index.js +98 -0
- package/server/dist/features/note/services/properties.js +21 -1
- package/server/dist/features/note/services/property-restore.js +26 -0
- package/server/dist/features/note/services/search.js +5 -0
- package/server/dist/features/note/services/snapshot.js +82 -58
- package/server/dist/features/note/services/trash.js +18 -31
- package/server/dist/features/note/services/write.js +10 -3
- package/server/dist/features/search/embedding-api-key-store.js +57 -0
- package/server/dist/features/search/embedding-client.js +179 -0
- package/server/dist/features/search/graphql/index.js +6 -0
- package/server/dist/features/search/graphql/resolver.js +32 -0
- package/server/dist/features/search/graphql/type-defs.js +37 -0
- package/server/dist/features/search/http/handlers.js +108 -0
- package/server/dist/features/search/hybrid-ranking.js +57 -0
- package/server/dist/features/search/hybrid-search.js +176 -0
- package/server/dist/features/search/note-change.js +16 -0
- package/server/dist/features/search/note-chunking.js +75 -0
- package/server/dist/features/search/related-notes.js +186 -0
- package/server/dist/features/search/search-config.js +150 -0
- package/server/dist/features/search/search-manager.js +431 -0
- package/server/dist/features/search/semantic-indexer.js +138 -0
- package/server/dist/features/search/sqlite-vector-index.js +636 -0
- package/server/dist/features/search/url-normalization.js +10 -0
- package/server/dist/features/tag/services/organization.js +3 -0
- package/server/dist/features/view/services/workspace.js +1 -1
- package/server/dist/main.js +12 -3
- package/server/dist/modules/blocknote.js +4 -5
- package/server/dist/paths.js +7 -2
- package/server/dist/routes/api.js +37 -0
- package/server/dist/routes/mcp.js +0 -5
- package/server/dist/schema/index.js +3 -0
- package/server/prisma/migrations/20260728090000_0019_note_reference_index/migration.sql +15 -0
- package/server/prisma/schema.prisma +16 -0
- package/server/client/dist/assets/Calendar-BP6HTuSn.js +0 -25
- package/server/client/dist/assets/Graph-Xha3fwhp.js +0 -46
- package/server/client/dist/assets/Image-BLEjLUqd.js +0 -1
- package/server/client/dist/assets/Note-DjrCYtat.js +0 -24
- package/server/client/dist/assets/NotePropertiesPanel-2DgXEM4B.js +0 -2
- package/server/client/dist/assets/Reminders-B4l3KdlK.js +0 -1
- package/server/client/dist/assets/Search-BN5sf7bE.js +0 -1
- package/server/client/dist/assets/SurfaceCard-BZm73nyS.js +0 -1
- package/server/client/dist/assets/Tag-oSnmViVp.js +0 -1
- package/server/client/dist/assets/TagNotes-BDTCcJcL.js +0 -1
- package/server/client/dist/assets/ViewNotes-CiZtGJNE.js +0 -1
- package/server/client/dist/assets/ViewSectionDialog-Ctl_694Y.js +0 -102
- package/server/client/dist/assets/Views-D-zlatYD.js +0 -1
- package/server/client/dist/assets/app-DmqIOMWF.css +0 -1
- package/server/client/dist/assets/app-cTRcKMGc.js +0 -26
- package/server/client/dist/assets/image.api-CVuuvTBk.js +0 -17
- package/server/client/dist/assets/index-DKJChPr4.js +0 -1
- package/server/client/dist/assets/manage-image-BZjaxp-f.js +0 -1
- package/server/client/dist/assets/manage-image-detail-DPv0FQ2m.js +0 -1
- package/server/client/dist/assets/properties-D447wsWk.js +0 -1
- package/server/client/dist/assets/time-B3pt8vt4.js +0 -9
- package/server/client/dist/assets/trash-8sH7EZgc.js +0 -1
- package/server/client/dist/assets/url-BSnWpmJx.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Calendar-D7QJsAlg.js","assets/floating-ui.react-dom-BWTnA00G.js","assets/note.api-D3oJmG3q.js","assets/url-9nrbQs7Z.js","assets/time-D5LRMumI.js","assets/Callout-BTd1BYtV.js","assets/preload-helper-BXl3LOEh.js","assets/Graph-LY_IgMYy.js","assets/Views-CWE99SnI.js","assets/tag.api-DNSQpqwk.js","assets/ViewSectionDialog-DhH8harC.js","assets/ViewChip-DlCkL4z4.js","assets/SurfaceCard-t7pdfhEe.js","assets/ArrowRight.es-BEhnlwfe.js","assets/Plus.es-DRfLW_bI.js","assets/Reminders-COr1OHvF.js","assets/useReminderMutate-BrGO9M0o.js","assets/Graph-DYUb7gQb.js","assets/transform-BUB79_za.js","assets/isObject-U9U2HXiq.js","assets/toNumber-DE3J3kMD.js","assets/ordinal-Cboi1Yqb.js","assets/init-Gi6I4Gst.js","assets/colors-Cc3OSVma.js","assets/min-tv6RD-6E.js","assets/Search-Ctkx0BQk.js","assets/AuxiliaryPanelHeader-B1k7pZpn.js","assets/search-admin-adapter-CJnJmL6w.js","assets/File.es-Ct7fscBg.js","assets/Tag-BjxtrIQW.js","assets/Note-DsMhwrHw.js","assets/NotePropertiesPanel-aCKXAe5F.js","assets/note-ui-CtijppHK.js","assets/note-core-DUTqUh5N.js","assets/note-runtime-zN5ddTba.js","assets/note-ui-DL8owV-U.css","assets/image.api-CyQisInP.js","assets/Copy.es-BoLjilxv.js","assets/PencilLine.es-0JpEgxFY.js","assets/TagNotes-DV_fdRbg.js","assets/ViewNotes-wWWeFJyU.js","assets/index-B-E1Ilh9.js","assets/mcp-admin-adapter-PMmgPupc.js","assets/Image.es-OYyN3BYt.js","assets/Trash.es-Bo1VyK9Q.js","assets/mcp-CCaFd0zm.js","assets/search-D-xKTPdO.js","assets/trash-D4-9sv8q.js","assets/manage-image-azmo5iVw.js","assets/image-delete-confirmation-D7xrODQV.js","assets/manage-image-detail-BF-uSqb_.js","assets/properties-BrNJLkxR.js","assets/placeholder-AusSo8p9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as p,r as u,b as K,a as lt}from"./floating-ui.react-dom-BWTnA00G.js";import{v as Ss,x as Rs,y as Es,z as Cs,A as Ps,l as _s,u as Ls,a as Ms,b as As,e as Jo,o as Is,s as Ts,j as Ds,n as Ns,d as ho,t as js,m as Os,f as ks,R as Vs}from"./time-D5LRMumI.js";import{ao as Ze,ap as gt,aq as ee,ar as q,as as vt,at as Ke,au as er,av as Fs,aw as Hs,ax as Bs,ay as Zs,az as $s,aA as zs,aB as Us,aC as $e,aD as fo,aE as Ks,aF as mn,aG as Gs,aH as po,aI as se,aJ as mo,aK as at,aL as Ws,aM as qs,aN as Rt,aO as Xs,aP as O,aQ as go,aR as Ys,aS as Qs,aT as Js,aU as ea,af as we,ab as On,aV as ta,aW as vo,aX as fe,aY as gn,aZ as Nt,a_ as kn,a$ as na,b0 as oa,A as Et,f as Ge,u as Vn,b1 as ra,b2 as sa,b3 as aa,b4 as ia,T as te,x as vn,b5 as tr,y as it,b6 as nr,b7 as ca,L as la,D as ua,c as ae,g as Fn,H as da,q as bt,e as ha,i as or,Q as rr,an as fa,l as ut,F as zt,b8 as pa,a0 as ma,aj as ga,G as va,h as ba,P as ya,k as xa,E as wa,b9 as Sa,ba as Ra,bb as Ea,bc as H,$ as Cn,bd as bo,be as Ca}from"./note.api-D3oJmG3q.js";import{_ as Z}from"./preload-helper-BXl3LOEh.js";import{g as Ct,N as Hn,H as tn,c as sr,G as ar,C as ir,R as cr,b as lr,j as ur,T as dr,V as Pa,h as _a,i as La,S as Ma,e as Aa,d as Ia,f as Ta,a as Da}from"./url-9nrbQs7Z.js";import{f as hr,G as Na}from"./Graph-LY_IgMYy.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const Bn={DARK:"(prefers-color-scheme: dark)",LIGHT:"(prefers-color-scheme: light)",RETINA:"(min-resolution: 2dppx)",RESPONSIVE:e=>`screen and (max-width: ${e})`},fr=e=>typeof window<"u"&&window.matchMedia?window.matchMedia(e):null,Zn=(e,t,n=!0)=>{const o=fr(e);n&&t(o?.matches||!1);const r=s=>{t?.(s.matches)};return o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},ja=(e,t=!0)=>Zn(Bn.DARK,e,t),Oa=(e,t,n=!0)=>Zn(Bn.RESPONSIVE(e),t,n),ka={MEDIA_QUERY:Bn,listenThemeChange:ja,listenResponsiveChange:Oa,createMediaQuery:fr,listenMediaQueryChange:Zn};var N=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(N||{});function pr({update:e,notify:t,unwatched:n}){return{link:o,unlink:r,propagate:s,checkDirty:a,shallowPropagate:i};function o(c,d,h){const f=d.depsTail;if(f!==void 0&&f.dep===c)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===c){m.version=h,d.depsTail=m;return}const g=c.subsTail;if(g!==void 0&&g.version===h&&g.sub===d)return;const v=d.depsTail=c.subsTail={version:h,dep:c,sub:d,prevDep:f,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=v),f!==void 0?f.nextDep=v:d.deps=v,g!==void 0?g.nextSub=v:c.subs=v}function r(c,d=c.sub){const h=c.dep,f=c.prevDep,m=c.nextDep,g=c.nextSub,v=c.prevSub;return m!==void 0?m.prevDep=f:d.depsTail=f,f!==void 0?f.nextDep=m:d.deps=m,g!==void 0?g.prevSub=v:h.subsTail=v,v!==void 0?v.nextSub=g:(h.subs=g)===void 0&&n(h),m}function s(c){let d=c.nextSub,h;e:do{const f=c.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&l(c,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&t(f),m&1){const g=f.subs;if(g!==void 0){const v=(c=g).nextSub;v!==void 0&&(h={value:d,prev:h},d=v);continue}}if((c=d)!==void 0){d=c.nextSub;continue}for(;h!==void 0;)if(c=h.value,h=h.prev,c!==void 0){d=c.nextSub;continue e}break}while(!0)}function a(c,d){let h,f=0,m=!1;e:do{const g=c.dep,v=g.flags;if(d.flags&16)m=!0;else if((v&17)===17){if(e(g)){const b=g.subs;b.nextSub!==void 0&&i(b),m=!0}}else if((v&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(h={value:c,prev:h}),c=g.deps,d=g,++f;continue}if(!m){const b=c.nextDep;if(b!==void 0){c=b;continue}}for(;f--;){const b=d.subs,y=b.nextSub!==void 0;if(y?(c=h.value,h=h.prev):c=b,m){if(e(d)){y&&i(b),d=c.sub;continue}m=!1}else d.flags&=-33;d=c.sub;const w=c.nextDep;if(w!==void 0){c=w;continue e}}return m}while(!0)}function i(c){do{const d=c.sub,h=d.flags;(h&48)===32&&(d.flags=h|16,(h&6)===2&&t(d))}while((c=c.nextSub)!==void 0)}function l(c,d){let h=d.depsTail;for(;h!==void 0;){if(h===c)return!0;h=h.prevDep}return!1}}let $n=0,De=0,dt=0;const xe=[],{link:Dd,unlink:mr,propagate:Nd,checkDirty:Va,shallowPropagate:jd}=pr({update(e){return e.depsTail!==void 0?Za(e):$a(e)},notify(e){let t=dt,n=t;do if(xe[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(dt=t;n<--t;){const o=xe[n];xe[n++]=xe[t],xe[t]=o}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,nn(e)):Ka.call(e)}});function Fa(){return $n}function Ha(){++$n}function Ba(){--$n||Ua()}function Za(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,nn(e)}}function $a(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function za(e){const t=e.flags;if(t&16||t&32&&Va(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,nn(e)}}else e.flags=2}function Ua(){try{for(;De<dt;){const e=xe[De];xe[De++]=void 0,za(e)}}finally{for(;De<dt;){const e=xe[De];xe[De++]=void 0,e.flags|=10}De=0,dt=0}}function Ka(){this.depsTail=void 0,this.flags=0,nn(this);const e=this.subs;e!==void 0&&mr(e)}function nn(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=mr(n,e)}function zn(e,t,n){const o=typeof e=="object",r=o?e:void 0;return{next:(o?e.next:e)?.bind(r),error:(o?e.error:t)?.bind(r),complete:(o?e.complete:n)?.bind(r)}}const Pn=[];let Bt=0;const{link:yo,unlink:Ga,propagate:Wa,checkDirty:gr,shallowPropagate:xo}=pr({update(e){return e._update()},notify(e){Pn[_n++]=e,e.flags&=~N.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=N.Mutable|N.Dirty,Ut(e))}});let jt=0,_n=0,he;function Ut(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Ga(n,e)}function vr(){if(!(Fa()>0)){for(;jt<_n;){const e=Pn[jt];Pn[jt++]=void 0,e.notify()}jt=0,_n=0}}function br(e,t){const n=typeof e=="function",o=e,r={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?N.None:N.Mutable,get(){return he!==void 0&&yo(r,he,Bt),r._snapshot},subscribe(s){const a=zn(s),i={current:!1},l=qa(()=>{r.get(),i.current?a.next?.(r._snapshot):i.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(s){const a=he,i=Object.is;if(n)he=r,++Bt,r.depsTail=void 0;else if(s===void 0)return!1;n&&(r.flags=N.Mutable|N.RecursedCheck);try{const l=r._snapshot,c=typeof s=="function"?s(l):s===void 0&&n?o(l):s;return l===void 0||!i(l,c)?(r._snapshot=c,!0):!1}finally{he=a,n&&(r.flags&=~N.RecursedCheck),Ut(r)}}};return n?(r.flags=N.Mutable|N.Dirty,r.get=function(){const s=r.flags;if(s&N.Dirty||s&N.Pending&&gr(r.deps,r)){if(r._update()){const a=r.subs;a!==void 0&&xo(a)}}else s&N.Pending&&(r.flags=s&~N.Pending);return he!==void 0&&yo(r,he,Bt),r._snapshot}):r.set=function(s){if(r._update(s)){const a=r.subs;a!==void 0&&(Wa(a),xo(a),vr())}},r}function qa(e){const t=()=>{const o=he;he=n,++Bt,n.depsTail=void 0,n.flags=N.Watching|N.RecursedCheck;try{return e()}finally{he=o,n.flags&=~N.RecursedCheck,Ut(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:N.Watching|N.RecursedCheck,notify(){const o=this.flags;o&N.Dirty||o&N.Pending&&gr(this.deps,this)?t():this.flags=N.Watching},stop(){this.flags=N.None,this.depsTail=void 0,Ut(this)}};return t(),n}class Xa{constructor(t){this.atom=br(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}class Ya{constructor(t){this.atom=br(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(zn(t))}}function Qa(e){return typeof e=="function"?new Ya(e):new Xa(e)}function Ja(e){try{Ha(),e()}finally{Ba(),vr()}}const Ae="__TSR_index",wo="popstate",So="beforeunload";function ei(e){let t=e.getLocation();const n=new Set,o=a=>{t=e.getLocation(),n.forEach(i=>i({location:t,action:a}))},r=a=>{e.notifyOnIndexChange??!0?o(a):t=e.getLocation()},s=async({task:a,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){a();return}const d=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const f of d){const m=Kt(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:m,action:l.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,i,l)=>{const c=t.state[Ae];i=Ro(c+1,i),s({task:()=>{e.pushState(a,i),o({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:i})},replace:(a,i,l)=>{const c=t.state[Ae];i=Ro(c,i),s({task:()=>{e.replaceState(a,i),o({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:i})},go:(a,i)=>{s({task:()=>{e.go(a),r({type:"GO",index:a})},navigateOpts:i,type:"GO"})},back:a=>{s({task:()=>{e.back(a?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{e.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[Ae]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const i=e.getBlockers?.()??[];return e.setBlockers([...i,a]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(c=>c!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function Ro(e,t){t||(t={});const n=Un();return{...t,key:n,__TSR_key:n,[Ae]:e}}function ti(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let r=[];const s=()=>r,a=x=>r=x,i=(x=>x),l=(()=>Kt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const x=Un();t.history.replaceState({[Ae]:0,key:x,__TSR_key:x},"")}let c=l(),d,h=!1,f=!1,m=!1,g=!1;const v=()=>c;let b,y;const w=()=>{b&&(E._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),E._ignoreSubscribers=!1,b=void 0,y=void 0,d=void 0)},R=(x,C,I)=>{const _=i(C);y||(d=c),c=Kt(C,I),b={href:_,state:I,isPush:b?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>w()))},S=x=>{c=l(),E.notify({type:x})},P=async()=>{if(f){f=!1;return}const x=l(),C=x.state[Ae]-c.state[Ae],I=C===1,_=C===-1,M=!I&&!_||h;h=!1;const U=M?"GO":_?"BACK":"FORWARD",D=M?{type:"GO",index:C}:{type:_?"BACK":"FORWARD"};if(m)m=!1;else{const ce=s();if(typeof document<"u"&&ce.length){for(const G of ce)if(await G.blockerFn({currentLocation:c,nextLocation:x,action:U})){f=!0,t.history.go(1),E.notify(D);return}}}c=l(),E.notify(D)},L=x=>{if(g){g=!1;return}let C=!1;const I=s();if(typeof document<"u"&&I.length)for(const _ of I){const M=_.enableBeforeUnload??!0;if(M===!0){C=!0;break}if(typeof M=="function"&&M()===!0){C=!0;break}}if(C)return x.preventDefault(),x.returnValue=""},E=ei({getLocation:v,getLength:()=>t.history.length,pushState:(x,C)=>R("push",x,C),replaceState:(x,C)=>R("replace",x,C),back:x=>(x&&(m=!0),g=!0,t.history.back()),forward:x=>{x&&(m=!0),g=!0,t.history.forward()},go:x=>{h=!0,t.history.go(x)},createHref:x=>i(x),flush:w,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(So,L,{capture:!0}),t.removeEventListener(wo,P)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(So,L,{capture:!0}),t.addEventListener(wo,P),t.history.pushState=function(...x){const C=n.apply(t.history,x);return E._ignoreSubscribers||S("PUSH"),C},t.history.replaceState=function(...x){const C=o.apply(t.history,x);return E._ignoreSubscribers||S("REPLACE"),C},E}function ni(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Kt(e,t){const n=ni(e),o=n.indexOf("#"),r=n.indexOf("?"),s=Un();return{href:n,pathname:n.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:n.length),hash:o>-1?n.substring(o):"",search:r>-1?n.slice(r,o===-1?void 0:o):"",state:t||{[Ae]:0,key:s,__TSR_key:s}}}function Un(){return(Math.random()+1).toString(36).substring(7)}const oi=!1;function ht(e){let t;return Ja(()=>{t=e()}),t}function ri(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ln="tsr-scroll-restoration-v1_3",si=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function ai(){const e=ri();if(!e)return null;const t=e.getItem(Ln);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=Ze(o,n)||n;try{e.setItem(Ln,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ot=ai(),ii=e=>e.state.__TSR_key||e.href;function ci(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Gt=!1;function li({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:r,location:s}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(c){console.error(c);return}const i=t||window.history.state?.__TSR_key,l=a[i];Gt=!0;e:{if(o&&l&&Object.keys(l).length>0){for(const h in l){const f=l[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:n});else if(h){const m=document.querySelector(h);m&&(m.scrollLeft=f.scrollX,m.scrollTop=f.scrollY)}}break e}const c=(s??window.location).hash.split("#",2)[1];if(c){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(c);f&&f.scrollIntoView(h)}break e}const d={top:0,left:0,behavior:n};if(window.scrollTo(d),r)for(const h of r){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(d)}}Gt=!1}function ui(e,t){if(!Ot||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ot))return;e.isScrollRestorationSetup=!0,Gt=!1;const o=e.options.getScrollRestorationKey||ii;window.history.scrollRestoration="manual";const r=s=>{if(Gt||!e.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const l=s.target.getAttribute("data-scroll-restoration-id");l?a=`[data-scroll-restoration-id="${l}"]`:a=ci(s.target)}const i=o(e.state.location);Ot.set(l=>{const c=l[i]||={},d=c[a]||={};if(a==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",si(r,100),!0),e.subscribe("onRendered",s=>{const a=o(s.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(li({storageKey:Ln,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ot.set(i=>(i[a]||={},i)))})}function di(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function hi(e,t=String){const n=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&n.set(o,t(r))}return n.toString()}function bn(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function fi(e){const t=new URLSearchParams(e),n={};for(const[o,r]of t.entries()){const s=n[o];s==null?n[o]=bn(r):Array.isArray(s)?s.push(bn(r)):n[o]=[s,bn(r)]}return n}const pi=gi(JSON.parse),mi=vi(JSON.stringify,JSON.parse);function gi(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=fi(t);for(const o in n){const r=n[o];if(typeof r=="string")try{n[o]=e(r)}catch{}}return n}}function vi(e,t){const n=typeof t=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(n&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const s=hi(r,o);return s?`?${s}`:""}}const Mn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},on=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),ze=(e,t,n=!0)=>{const o={...e.router.options.context??{}},r=n?t:t-1;for(let s=0;s<=r;s++){const a=e.matches[s];if(!a)continue;const i=e.router.getMatch(a.id);i&&Object.assign(o,i.__routeContext,i.__beforeLoadContext)}return o},Eo=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(a=>a.routeId===e.router.routeTree.id),r=o>=0?o:0;let s=n?e.matches.findIndex(a=>a.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=r);for(let a=s;a>=0;a--){const i=e.matches[a];if(e.router.looseRoutesById[i.routeId].options.notFoundComponent)return a}return n?s:r},Me=(e,t,n)=>{if(!(!ee(n)&&!q(n)))throw ee(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:ee(n)?"redirected":o.status==="pending"?"success":o.status,context:ze(e,t.index),isFetching:!1,error:n})),q(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ee(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},yr=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,ct=(e,t,n,o)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??=t,Me(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(i){n=i,Me(e,e.router.getMatch(r),n)}e.updateMatch(r,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ee(n)&&!q(n)&&(e.serialError??=n)},xr=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!on(e,t)&&(n.options.loader||n.options.beforeLoad||Sr(n))&&typeof r=="number"&&r!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{Mn(e)},r);o._nonReactive.pendingTimeout=a}},bi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;xr(e,t,n,o);const r=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Me(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},yi=(e,t,n,o)=>{const r=e.router.getMatch(t),s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ke(()=>{s?.resolve()});const{paramsError:a,searchError:i}=r;a&&ct(e,n,a,"PARSE_PARAMS"),i&&ct(e,n,i,"VALIDATE_SEARCH"),xr(e,t,o,r);const l=new AbortController;let c=!1;const d=()=>{c||(c=!0,e.updateMatch(t,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:l})))},h=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,S=>({...S,isFetching:!1}))};if(!o.options.beforeLoad){ht(()=>{d(),h()});return}r._nonReactive.beforeLoadPromise=Ke();const f={...ze(e,n,!1),...r.__routeContext},{search:m,params:g,cause:v}=r,b=on(e,t),y={search:m,abortController:l,params:g,preload:b,context:f,location:e.location,navigate:S=>e.router.navigate({...S,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},w=S=>{if(S===void 0){ht(()=>{d(),h()});return}(ee(S)||q(S))&&(d(),ct(e,n,S,"BEFORE_LOAD")),ht(()=>{d(),e.updateMatch(t,P=>({...P,__beforeLoadContext:S})),h()})};let R;try{if(R=o.options.beforeLoad(y),gt(R))return d(),R.catch(S=>{ct(e,n,S,"BEFORE_LOAD")}).then(w)}catch(S){d(),ct(e,n,S,"BEFORE_LOAD")}w(R)},xi=(e,t)=>{const{id:n,routeId:o}=e.matches[t],r=e.router.looseRoutesById[o],s=()=>i(),a=()=>yi(e,n,t,r),i=()=>{if(yr(e,n))return;const l=bi(e,n,r);return gt(l)?l.then(a):a()};return s()},wi=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(r),n.options.scripts?.(r),n.options.headers?.(r)]).then(([s,a,i])=>{const l=s?.meta,c=s?.links,d=s?.scripts,h=s?.styles;return{meta:l,links:c,headScripts:d,headers:i,scripts:a,styles:h}})},wr=(e,t,n,o,r)=>{const s=t[o-1],{params:a,loaderDeps:i,abortController:l,cause:c}=e.router.getMatch(n),d=ze(e,o),h=on(e,n);return{params:a,deps:i,preload:!!h,parentMatchPromise:s,abortController:l,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:h?"preload":c,route:r,...e.router.options.additionalContext}},Co=async(e,t,n,o,r)=>{try{const s=e.router.getMatch(n);try{(!(oi??e.router.isServer)||s.ssr===!0)&&Wt(r);const a=r.options.loader?.(wr(e,t,n,o,r)),i=r.options.loader&>(a);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,d=>({...d,isFetching:"loader"})),r.options.loader){const d=i?await a:a;Me(e,e.router.getMatch(n),d),d!==void 0&&e.updateMatch(n,h=>({...h,loaderData:d}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(n,d=>({...d,error:void 0,context:ze(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let i=a;if(i?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,c=>({...c,status:c.status==="pending"?"success":c.status,isFetching:!1,context:ze(e,o)}));return}const l=s._nonReactive.minPendingPromise;l&&await l,q(a)&&await r.options.notFoundComponent?.preload?.(),Me(e,e.router.getMatch(n),a);try{r.options.onError?.(a)}catch(c){i=c,Me(e,e.router.getMatch(n),c)}e.updateMatch(n,c=>({...c,error:i,context:ze(e,o),status:"error",isFetching:!1}))}}catch(s){const a=e.router.getMatch(n);a&&(a._nonReactive.loaderPromise=void 0),Me(e,a,s)}},Si=async(e,t,n)=>{async function o(h,f,m,g){const v=Date.now()-f.updatedAt,b=h?g.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??e.router.options.defaultStaleTime??0,y=g.options.shouldReload,w=typeof y=="function"?y(wr(e,t,r,n,g)):y,{status:R,invalid:S}=m;a=R==="success"&&(S||(w??v>b)),h&&g.options.preload===!1||(a&&!e.sync?(i=!0,(async()=>{try{await Co(e,t,r,n,g);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){ee(P)&&await e.router.navigate(P.options)}})()):(R!=="success"||a&&e.sync)&&await Co(e,t,r,n,g))}const{id:r,routeId:s}=e.matches[n];let a=!1,i=!1;const l=e.router.looseRoutesById[s];if(!yr(e,r)){const h=e.router.getMatch(r),f=on(e,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const m=e.router.getMatch(r),g=m._nonReactive.error||m.error;g&&Me(e,m,g),m.status==="pending"&&await o(f,h,m,l)}else{const m=f&&!e.router.state.matches.some(v=>v.id===r),g=e.router.getMatch(r);g._nonReactive.loaderPromise=Ke(),m!==g.preload&&e.updateMatch(r,v=>({...v,preload:m})),await o(f,h,g,l)}}const c=e.router.getMatch(r);i||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,i||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const d=i?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(r)):c};async function Po(e){const t=e,n=[];t.router.state.matches.some(f=>f._forcePending)&&Mn(t);let o;for(let f=0;f<t.matches.length;f++){try{const m=xi(t,f);gt(m)&&await m}catch(m){if(ee(m))throw m;if(q(m))o=m;else if(!t.preload)throw m;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,s=o&&!t.preload?Eo(t,o):void 0,a=o&&t.preload?0:s!==void 0?Math.min(s+1,r):r;let i,l;for(let f=0;f<a;f++)n.push(Si(t,n,f));try{await Promise.all(n)}catch{const f=await Promise.allSettled(n);for(const m of f){if(m.status!=="rejected")continue;const g=m.reason;if(ee(g))throw g;q(g)?i??=g:l??=g}if(l!==void 0)throw l}const c=i??(o&&!t.preload?o:void 0);let d=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!c&&o&&t.preload)return t.matches;if(c){const f=Eo(t,c);vt(f!==void 0);const m=t.matches[f],g=t.router.looseRoutesById[m.routeId],v=t.router.options?.defaultNotFoundComponent;!g.options.notFoundComponent&&v&&(g.options.notFoundComponent=v),c.routeId=m.routeId;const b=m.routeId===t.router.routeTree.id;t.updateMatch(m.id,y=>({...y,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:c},isFetching:!1})),d=f,await Wt(g)}else if(!t.preload){const f=t.matches[0];f.globalNotFound||t.router.getMatch(f.id)?.globalNotFound&&t.updateMatch(f.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const f=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Wt(f)}for(let f=0;f<=d;f++){const m=t.matches[f],{id:g,routeId:v}=m,b=t.router.looseRoutesById[v];try{const y=wi(t,g,b);if(y){const w=await y;t.updateMatch(g,R=>({...R,...w}))}}catch(y){console.error(`Error executing head for route ${v}:`,y)}}const h=Mn(t);if(gt(h)&&await h,c)throw c;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}async function Wt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const o of Rr){const r=e.options[o]?.preload;r&&n.push(r())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Sr(e){for(const t of Rr)if(e.options[t]?.preload)return!0;return!1}const Rr=["component","errorComponent","pendingComponent","notFoundComponent"];function Ri(e){return{input:({url:t})=>{for(const n of e)t=An(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Er(e[n],t);return t}}}function Ei(e){const t=er(e.basepath),n=`/${t}`,o=`${n}/`,r=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?o:o.toLowerCase();return{input:({url:a})=>{const i=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return i===r?a.pathname="/":i.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=Fs(["/",t,a.pathname]),a)}}function An(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Er(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ne(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,r=t?.href!==n.href,s=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:r,hashChanged:s}}function Ci(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class Pi{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const o=this.options,r=this.basepath??o?.basepath??"/",s=this.basepath===void 0,a=o?.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Hs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ti()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Bs(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=Qa(Li(this.latestLocation)),ui(this));let i=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(s||r!==l||a!==c){this.basepath=l;const f=[],m=er(l);m&&m!=="/"&&f.push(Ei({basepath:l})),c&&f.push(c),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Ri(f),this.history&&this.updateLatestLocation(),i=!0}i&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Zs(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&$s(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const r={eventType:n,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const r=({pathname:l,search:c,hash:d,href:h,state:f})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const w=this.options.parseSearch(c),R=this.options.stringifySearch(w);return{href:l+R+d,publicHref:h,pathname:at(l).path,external:!1,searchStr:R,search:se(o?.search,w),hash:at(d.slice(1)).path,state:se(o?.state,f)}}const m=new URL(h,this.origin),g=An(this.rewrite,m),v=this.options.parseSearch(g.search),b=this.options.stringifySearch(v);return g.search=b,{href:g.href.replace(g.origin,""),publicHref:h,pathname:at(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:b,search:se(o?.search,v),hash:at(g.hash.slice(1)).path,state:se(o?.state,f)}},s=r(n),{__tempLocation:a,__tempKey:i}=s.state;if(a&&(!i||i===this.tempLocationKey)){const l=r(a);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(n,o)=>zs({base:n,to:Us(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,r)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},r):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>Mi({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),o=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const o=(s={})=>{const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(a);s.from;const l=s.unsafeRelative==="path"?a.pathname:s.from??i.fullPath,c=this.resolvePathWithBase(l,"."),d=i.search,h={...i.params},f=s.to?this.resolvePathWithBase(c,`${s.to}`):this.resolvePathWithBase(c,"."),m=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,Ze(s.params,h)),g=this.getMatchedRoutes(f);let v=g.matchedRoutes;if((!g.foundRoute||g.foundRoute.path!=="/"&&g.routeParams["**"])&&this.options.notFoundRoute&&(v=[...v,this.options.notFoundRoute]),Object.keys(m).length>0)for(const _ of v){const M=_.options.params?.stringify??_.options.stringifyParams;if(M)try{Object.assign(m,M(m))}catch{}}const y=n.leaveParams?f:at(po({path:f,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let w=d;if(n._includeValidateSearch&&this.options.search?.strict){const _={};v.forEach(M=>{if(M.options.validateSearch)try{Object.assign(_,Zt(M.options.validateSearch,{..._,...w}))}catch{}}),w=_}w=Ai({search:w,dest:s,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),w=se(d,w);const R=this.options.stringifySearch(w),S=s.hash===!0?a.hash:s.hash?Ze(s.hash,a.hash):void 0,P=S?`#${S}`:"";let L=s.state===!0?a.state:s.state?Ze(s.state,a.state):{};L=se(a.state,L);const E=`${y}${R}${P}`;let x,C,I=!1;if(this.rewrite){const _=new URL(E,this.origin),M=Er(this.rewrite,_);x=_.href.replace(_.origin,""),M.origin!==this.origin?(C=M.href,I=!0):C=M.pathname+M.search+M.hash}else x=Xs(E),C=x;return{publicHref:C,href:x,pathname:y,search:w,searchStr:R,state:L,hash:S??"",external:I,unmaskOnReload:s.unmaskOnReload}},r=(s={},a)=>{const i=o(s);let l=a?o(a):void 0;if(!l){const c={};if(this.options.routeMasks){const d=Ws(i.pathname,this.processedTree);if(d){Object.assign(c,d.rawParams);const{from:h,params:f,...m}=d.route,g=f===!1||f===null?{}:(f??!0)===!0?c:Object.assign(c,Ze(f,c));a={from:n.from,...m,params:g},l=o(a)}}}return l&&(i.maskedLocation=l),i};return n.mask?r(n,{from:n.from,...n.mask}):r(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...r})=>{const s=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(d=>{r.state[d]=this.latestLocation.state[d]});const c=mn(r.state,this.latestLocation.state);return l.forEach(d=>{delete r.state[d]}),c},a=$e(this.latestLocation.href)===$e(r.href),i=this.commitLocationPromise;if(this.commitLocationPromise=Ke(()=>{i?.resolve()}),a&&s())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...d}=r;l&&(d={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[r.replace?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:o})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:a,href:i,...l}={})=>{if(i){const h=this.history.location.state.__TSR_index,f=Kt(i,{__TSR_index:n?h:h+1}),m=new URL(f.pathname,this.origin),g=An(this.rewrite,m);l.to=g.pathname,l.search=this.options.parseSearch(f.search),l.hash=f.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const d=this.commitLocation({...c,viewTransition:s,replace:n,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:n,reloadDocument:o,href:r,publicHref:s,...a})=>{let i=!1;if(r)try{new URL(`${r}`),i=!0}catch{}if(i&&!o&&(o=!0),o){if(n!==void 0||!r){const c=this.buildLocation({to:n,...a});r=r??c.publicHref,s=s??c.publicHref}const l=!i&&s?s:r;if(fo(l,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(r=>!n.some(s=>s.id===r.id))}))},this.load=async n=>{let o,r,s;for(s=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,c=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ne({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...Ne({resolvedLocation:c,location:l})}),await Po({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],f=[],m=[];ht(()=>{this.__store.setState(g=>{const v=g.matches,b=g.pendingMatches||g.matches;return d=v.filter(y=>!b.some(w=>w.id===y.id)),h=v.filter(y=>!b.some(w=>w.routeId===y.routeId)),f=b.filter(y=>!v.some(w=>w.routeId===y.routeId)),m=b.filter(y=>v.some(w=>w.routeId===y.routeId)),{...g,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...g.cachedMatches,...d.filter(y=>y.status!=="error"&&y.status!=="notFound"&&y.status!=="redirected")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[f,"onEnter"],[m,"onStay"]].forEach(([g,v])=>{g.forEach(b=>{this.looseRoutesById[b.routeId].options[v]?.(b)})})})})}})}catch(l){ee(l)?(o=l,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):q(l)&&(r=l),this.__store.setState(c=>({...c,statusCode:o?o.status:r?404:c.matches.some(d=>d.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(i=>i.status==="error")&&(a=500),a!==void 0&&this.__store.setState(i=>({...i,statusCode:a}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,i=typeof o.types=="function"?o.types(Ne({resolvedLocation:a,location:s})):o.types;if(i===!1){n();return}r={update:n,types:i}}else r=n;document.startViewTransition(r)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(s=>s.id===n)?"pendingMatches":this.state.matches.some(s=>s.id===n)?"matches":this.state.cachedMatches.some(s=>s.id===n)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(s=>({...s,cachedMatches:Ci(s.cachedMatches.map(a=>a.id===n?o(a):a))})):this.__store.setState(s=>({...s,[r]:s[r]?.map(a=>a.id===n?o(a):a)})))})},this.getMatch=n=>{const o=r=>r.id===n;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=n=>{const o=r=>n?.filter?.(r)??!0?{...r,invalid:!0,...n?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(o),cachedMatches:r.cachedMatches.map(o),pendingMatches:r.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const r=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(r);n.options.href=s,n.headers.set("Location",s)}else if(o)try{const r=new URL(o);if(this.origin&&r.origin===this.origin){const s=r.pathname+r.search+r.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}if(n.options.href&&!n.options._builtLocation&&fo(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n?.filter;o!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(s=>!o(s))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const r=this.looseRoutesById[o.routeId];if(!r.options.loader)return!0;const s=(o.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=Wt,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let r=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(i=>i.id)),a=new Set([...s,...this.state.cachedMatches.map(i=>i.id)]);ht(()=>{r.forEach(i=>{a.has(i.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,i]}))})});try{return r=await Po({router:this,matches:r,location:o,preload:!0,updateMatch:(i,l)=>{s.has(i)?r=r.map(c=>c.id===i?l(c):c):this.updateMatch(i,l)}}),r}catch(i){if(ee(i))return i.options.reloadDocument?void 0:await this.preloadRoute({...i.options,_fromLocation:o});q(i)||console.error(i);return}},this.matchRoute=(n,o)=>{const r={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.state.status!=="pending")return!1;const i=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=Ks(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||n.params&&!mn(l.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?mn(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??mi,parseSearch:t.parseSearch??pi,protocolAllowlist:t.protocolAllowlist??Gs}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:o}){this.routesById=t,this.routesByPath=n,this.processedTree=o;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const o=this.getMatchedRoutes(t.pathname),{foundRoute:r,routeParams:s,parsedParams:a}=o;let{matchedRoutes:i}=o,l=!1;(r?r.path!=="/"&&s["**"]:$e(t.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:l=!0);const c=l?Ti(this.options.notFoundMode,i):void 0,d=new Array(i.length),h=new Map(this.state.matches.map(f=>[f.routeId,f]));for(let f=0;f<i.length;f++){const m=i[f],g=d[f-1];let v,b,y;{const D=g?.search??t.search,ce=g?._strictSearch??void 0;try{const G=Zt(m.options.validateSearch,{...D})??void 0;v={...D,...G},b={...ce,...G},y=void 0}catch(G){let V=G;if(G instanceof qt||(V=new qt(G.message,{cause:G})),n?.throwOnError)throw V;v=D,b={},y=V}}const w=m.options.loaderDeps?.({search:v})??"",R=w?JSON.stringify(w):"",{interpolatedPath:S,usedParams:P}=po({path:m.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),L=m.id+S+R,E=this.getMatch(L),x=h.get(m.id),C=E?._strictParams??P;let I;if(!E)try{_o(m,P,a,C)}catch(D){if(q(D)||ee(D)?I=D:I=new _i(D.message,{cause:D}),n?.throwOnError)throw I}Object.assign(s,C);const _=x?"stay":"enter";let M;if(E)M={...E,cause:_,params:x?.params??s,_strictParams:C,search:x?se(x.search,v):se(E.search,v),_strictSearch:b};else{const D=m.options.loader||m.options.beforeLoad||m.lazyFn||Sr(m)?"pending":"success";M={id:L,ssr:m.options.ssr,index:f,routeId:m.id,params:x?.params??s,_strictParams:C,pathname:S,updatedAt:Date.now(),search:x?se(x.search,v):v,_strictSearch:b,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:Ke()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:_,loaderDeps:x?se(x.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(M.globalNotFound=c===m.id),M.searchError=y;const U=this.getParentContext(g);M.context={...U,...M.__routeContext,...M.__beforeLoadContext},d[f]=M}for(let f=0;f<d.length;f++){const m=d[f],g=this.looseRoutesById[m.routeId],v=this.getMatch(m.id),b=h.get(m.routeId);if(m.params=b?se(b.params,s):s,!v){const y=d[f-1],w=this.getParentContext(y);if(g.options.context){const R={deps:m.loaderDeps,params:m.params,context:w??{},location:t,navigate:S=>this.navigate({...S,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:g.id};m.__routeContext=g.options.context(R)??void 0}m.context={...w,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:r}=this.getMatchedRoutes(t.pathname),s=mo(n),a={...t.search};for(const d of n)try{Object.assign(a,Zt(d.options.validateSearch,a))}catch{}const i=mo(this.state.matches),l=i&&i.routeId===s.id&&t.pathname===this.state.location.pathname;let c;if(l)c=i.params;else{const d={...o};for(const h of n)try{_o(h,o,r??{},d)}catch{}c=d}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:c}}}class qt extends Error{}class _i extends Error{}function Li(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Zt(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new qt("Async validation not supported");if(n.issues)throw new qt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Mi({pathname:e,routesById:t,processedTree:n}){const o={},r=$e(e);let s,a;const i=qs(r,n,!0);return i&&(s=i.route,Object.assign(o,i.rawParams),a=Object.assign({},i.parsedParams)),{matchedRoutes:i?.branch||[t[Rt]],routeParams:o,foundRoute:s,parsedParams:a}}function Ai({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return Ii(n)(e,t,o??!1)}function Ii(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const s=({search:a,next:i})=>{let l=a;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(l=r.options.preSearchFilters.reduce((d,h)=>h(d),a));const c=i(l);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((d,h)=>h(d),c):c};t.middlewares.push(s)}if(r.options.validateSearch){const s=({search:a,next:i})=>{const l=i(a);if(!t._includeValidateSearch)return l;try{return{...l,...Zt(r.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(s)}}const n=({search:r})=>{const s=t.dest;return s.search?s.search===!0?r:Ze(s.search,r):{}};t.middlewares.push(n);const o=(r,s,a)=>{if(r>=a.length)return s;const i=a[r];return i({search:s,next:c=>o(r+1,c,a)})};return function(s,a,i){return t.dest=a,t._includeValidateSearch=i,o(0,s,t.middlewares)}}function Ti(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return Rt}function _o(e,t,n,o){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(o[s]=n[s]);else{const s=r(o);Object.assign(o,s)}}function Kn(e){const t=e.errorComponent??Gn;return p.jsx(Di,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?u.createElement(t,{error:n,reset:o}):e.children})}class Di extends u.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Gn({error:e}){const[t,n]=u.useState(!1);return p.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[p.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),p.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),p.jsx("div",{style:{height:".25rem"}}),t?p.jsx("div",{children:p.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?p.jsx("code",{children:e.message}):null})}):null]})}function Lo(e){return typeof e=="object"?new Mo(e,{silent:!0}).createRoute(e):new Mo(e,{silent:!0}).createRoute}class Mo{constructor(t,n){this.path=t,this.createRoute=o=>{const r=O(o);return r.isRoot=!1,r},this.silent=n?.silent}}class Ao{constructor(t){this.useMatch=n=>go({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>go({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ys({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Qs({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Js({...n,from:this.options.id}),this.useLoaderData=n=>ea({...n,from:this.options.id}),this.useNavigate=()=>{const n=we();return On({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Io(e){return typeof e=="object"?new Ao(e):t=>new Ao({id:e,...t})}function $(e,t){let n,o,r,s;const a=()=>(n||(n=e().then(l=>{n=void 0,o=l.default}).catch(l=>{if(r=l,ta(r)&&r instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const c=`tanstack_router_reload:${r.message}`;sessionStorage.getItem(c)||(sessionStorage.setItem(c,"1"),s=!0)}})),n),i=function(c){if(s)throw window.location.reload(),new Promise(()=>{});if(r)throw r;if(!o)if(vo)vo(a());else throw a();return u.createElement(o,c)};return i.preload=a,i}function Ni(){const e=we(),t=u.useRef({router:e,mounted:!1}),[n,o]=u.useState(!1),{hasPendingMatches:r,isLoading:s}=fe({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),a=gn(s),i=s||n||r,l=gn(i),c=s||r,d=gn(c);return e.startTransition=h=>{o(!0),u.startTransition(()=>{h(),o(!1)})},u.useEffect(()=>{const h=e.history.subscribe(e.load),f=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $e(e.latestLocation.publicHref)!==$e(f.publicHref)&&e.commitLocation({...f,replace:!0}),()=>{h()}},[e,e.history]),Nt(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(f){console.error(f)}})()},[e]),Nt(()=>{a&&!s&&e.emit({type:"onLoad",...Ne(e.state)})},[a,e,s]),Nt(()=>{d&&!c&&e.emit({type:"onBeforeRouteMount",...Ne(e.state)})},[c,d,e]),Nt(()=>{if(l&&!i){const h=Ne(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),h.hrefChanged&&di(e)}},[i,l,e]),null}function ji(e){const t=fe({select:n=>`not-found-${n.location.pathname}-${n.status}`});return p.jsx(Kn,{getResetKey:()=>t,onCatch:(n,o)=>{if(q(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(q(n))return e.fallback?.(n);throw n},children:e.children})}function Oi(){return p.jsx("p",{children:"Not Found"})}function Be(e){return p.jsx(p.Fragment,{children:e.children})}function Cr(e,t,n){return t.options.notFoundComponent?p.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?p.jsx(e.options.defaultNotFoundComponent,{...n}):p.jsx(Oi,{})}function ki(){return we().isScrollRestoring,null}const Pr=u.memo(function({matchId:t}){const n=we(),o=fe({select:v=>{const b=v.matches.findIndex(w=>w.id===t),y=v.matches[b];return vt(y),{routeId:y.routeId,ssr:y.ssr,_displayPending:y._displayPending,resetKey:v.loadedAt,parentRouteId:v.matches[b-1]?.routeId}},structuralSharing:!0}),r=n.routesById[o.routeId],s=r.options.pendingComponent??n.options.defaultPendingComponent,a=s?p.jsx(s,{}):null,i=r.options.errorComponent??n.options.defaultErrorComponent,l=r.options.onCatch??n.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??n.options.notFoundRoute?.options.component:r.options.notFoundComponent,d=o.ssr===!1||o.ssr==="data-only",h=(!r.isRoot||r.options.wrapInSuspense||d)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||d))?u.Suspense:Be,f=i?Kn:Be,m=c?ji:Be,g=r.isRoot?r.options.shellComponent??Be:Be;return p.jsxs(g,{children:[p.jsx(kn.Provider,{value:t,children:p.jsx(h,{fallback:a,children:p.jsx(f,{getResetKey:()=>o.resetKey,errorComponent:i||Gn,onCatch:(v,b)=>{if(q(v))throw v;l?.(v,b)},children:p.jsx(m,{fallback:v=>{if(!c||v.routeId&&v.routeId!==o.routeId||!v.routeId&&!r.isRoot)throw v;return u.createElement(c,v)},children:d||o._displayPending?p.jsx(na,{fallback:a,children:p.jsx(To,{matchId:t})}):p.jsx(To,{matchId:t})})})})}),o.parentRouteId===Rt&&n.options.scrollRestoration?p.jsxs(p.Fragment,{children:[p.jsx(Vi,{}),p.jsx(ki,{})]}):null]})});function Vi(){const e=we(),t=u.useRef(void 0);return p.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ne(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const To=u.memo(function({matchId:t}){const n=we(),{match:o,key:r,routeId:s}=fe({select:l=>{const c=l.matches.find(g=>g.id===t),d=c.routeId,f=(n.routesById[d].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:d,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:d,match:{id:c.id,status:c.status,error:c.error,invalid:c.invalid,_forcePending:c._forcePending,_displayPending:c._displayPending}}},structuralSharing:!0}),a=n.routesById[s],i=u.useMemo(()=>{const l=a.options.component??n.options.defaultComponent;return l?p.jsx(l,{},r):p.jsx(_r,{})},[r,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const l=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const c=n.getMatch(o.id);if(c&&!c._nonReactive.minPendingPromise){const d=Ke();c._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return vt(q(o.error)),Cr(n,a,o.error);if(o.status==="redirected")throw vt(ee(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return i}),_r=u.memo(function(){const t=we(),n=u.useContext(kn),o=fe({select:c=>c.matches.find(d=>d.id===n)?.routeId}),r=t.routesById[o],s=fe({select:c=>{const h=c.matches.find(f=>f.id===n);return vt(h),h.globalNotFound}}),a=fe({select:c=>{const d=c.matches,h=d.findIndex(f=>f.id===n);return d[h+1]?.id}}),i=t.options.defaultPendingComponent?p.jsx(t.options.defaultPendingComponent,{}):null;if(s)return Cr(t,r,void 0);if(!a)return null;const l=p.jsx(Pr,{matchId:a});return o===Rt?p.jsx(u.Suspense,{fallback:i,children:l}):l});function Fi(){const e=we(),n=e.routesById[Rt].options.pendingComponent??e.options.defaultPendingComponent,o=n?p.jsx(n,{}):null,r=typeof document<"u"&&e.ssr?Be:u.Suspense,s=p.jsxs(r,{fallback:o,children:[p.jsx(Ni,{}),p.jsx(Hi,{})]});return e.options.InnerWrap?p.jsx(e.options.InnerWrap,{children:s}):s}function Hi(){const e=we(),t=fe({select:r=>r.matches[0]?.id}),n=fe({select:r=>r.loadedAt}),o=t?p.jsx(Pr,{matchId:t}):null;return p.jsx(kn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:p.jsx(Kn,{getResetKey:()=>n,errorComponent:Gn,onCatch:void 0,children:o})})}const Bi=e=>new Zi(e);class Zi extends Pi{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Lo,globalThis.createLazyFileRoute=Io):typeof window<"u"&&(window.createFileRoute=Lo,window.createLazyFileRoute=Io);function $i({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=p.jsx(oa.Provider,{value:e,children:t});return e.options.Wrap?p.jsx(e.options.Wrap,{children:o}):o}function zi({router:e,...t}){return p.jsx($i,{router:e,...t,children:p.jsx(Fi,{})})}function rn(e){return fe({select:t=>e?.select?e.select(t.location):t.location})}const Ui=new Map([["bold",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Zm60-80v56a12,12,0,0,1-24,0V143.32a12,12,0,0,1-9.37-22l16-8A12,12,0,0,1,112,124Zm61.49,33.88L163.9,168H168a12,12,0,0,1,0,24H136a12,12,0,0,1-8.71-20.25L155.45,142a4,4,0,0,0,.55-2,4,4,0,0,0-7.47-2,12,12,0,0,1-20.78-12A28,28,0,0,1,180,140a27.77,27.77,0,0,1-5.64,16.86A10.63,10.63,0,0,1,173.49,157.88Z"}))],["duotone",u.createElement(u.Fragment,null,u.createElement("path",{d:"M216,48V88H40V48a8,8,0,0,1,8-8H208A8,8,0,0,1,216,48Z",opacity:"0.2"}),u.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["fill",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM112,184a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm56-8a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136a23.76,23.76,0,0,1-4.84,14.45L152,176ZM48,80V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80Z"}))],["light",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,34H182V24a6,6,0,0,0-12,0V34H86V24a6,6,0,0,0-12,0V34H48A14,14,0,0,0,34,48V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V48A14,14,0,0,0,208,34ZM48,46H74V56a6,6,0,0,0,12,0V46h84V56a6,6,0,0,0,12,0V46h26a2,2,0,0,1,2,2V82H46V48A2,2,0,0,1,48,46ZM208,210H48a2,2,0,0,1-2-2V94H210V208A2,2,0,0,1,208,210Zm-98-90v64a6,6,0,0,1-12,0V129.71l-7.32,3.66a6,6,0,1,1-5.36-10.74l16-8A6,6,0,0,1,110,120Zm59.57,29.25L148,178h20a6,6,0,0,1,0,12H136a6,6,0,0,1-4.8-9.6L160,142a10,10,0,1,0-16.65-11A6,6,0,1,1,133,125a22,22,0,1,1,36.62,24.26Z"}))],["regular",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"}))],["thin",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,36H180V24a4,4,0,0,0-8,0V36H84V24a4,4,0,0,0-8,0V36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36ZM48,44H76V56a4,4,0,0,0,8,0V44h88V56a4,4,0,0,0,8,0V44h28a4,4,0,0,1,4,4V84H44V48A4,4,0,0,1,48,44ZM208,212H48a4,4,0,0,1-4-4V92H212V208A4,4,0,0,1,208,212ZM108,120v64a4,4,0,0,1-8,0V126.47l-10.21,5.11a4,4,0,0,1-3.58-7.16l16-8A4,4,0,0,1,108,120Zm60,28-24,32h24a4,4,0,0,1,0,8H136a4,4,0,0,1-3.2-6.4l28.78-38.37A11.88,11.88,0,0,0,164,136a12,12,0,0,0-22.4-6,4,4,0,0,1-6.92-4A20,20,0,0,1,172,136,19.79,19.79,0,0,1,168,148Z"}))]]),Ki=new Map([["bold",u.createElement(u.Fragment,null,u.createElement("path",{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"}))],["duotone",u.createElement(u.Fragment,null,u.createElement("path",{d:"M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z",opacity:"0.2"}),u.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["fill",u.createElement(u.Fragment,null,u.createElement("path",{d:"M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z"}))],["light",u.createElement(u.Fragment,null,u.createElement("path",{d:"M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z"}))],["regular",u.createElement(u.Fragment,null,u.createElement("path",{d:"M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z"}))],["thin",u.createElement(u.Fragment,null,u.createElement("path",{d:"M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z"}))]]),Gi=new Map([["bold",u.createElement(u.Fragment,null,u.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,80H140V60h56ZM116,60v56H60V60ZM60,140h56v56H60Zm80,56V140h56v56Z"}))],["duotone",u.createElement(u.Fragment,null,u.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"}),u.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,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["fill",u.createElement(u.Fragment,null,u.createElement("path",{d:"M216,56v60a4,4,0,0,1-4,4H136V44a4,4,0,0,1,4-4h60A16,16,0,0,1,216,56ZM116,40H56A16,16,0,0,0,40,56v60a4,4,0,0,0,4,4h76V44A4,4,0,0,0,116,40Zm96,96H136v76a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V140A4,4,0,0,0,212,136ZM40,140v60a16,16,0,0,0,16,16h60a4,4,0,0,0,4-4V136H44A4,4,0,0,0,40,140Z"}))],["light",u.createElement(u.Fragment,null,u.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,14v66H134V54h66A2,2,0,0,1,202,56ZM56,54h66v68H54V56A2,2,0,0,1,56,54ZM54,200V134h68v68H56A2,2,0,0,1,54,200Zm146,2H134V134h68v66A2,2,0,0,1,200,202Z"}))],["regular",u.createElement(u.Fragment,null,u.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,80H136V56h64ZM120,56v64H56V56ZM56,136h64v64H56Zm144,64H136V136h64v64Z"}))],["thin",u.createElement(u.Fragment,null,u.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,12v68H132V52h68A4,4,0,0,1,204,56ZM56,52h68v72H52V56A4,4,0,0,1,56,52ZM52,200V132h72v72H56A4,4,0,0,1,52,200Zm148,4H132V132h72v68A4,4,0,0,1,200,204Z"}))]]),Wi=new Map([["bold",u.createElement(u.Fragment,null,u.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",u.createElement(u.Fragment,null,u.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),u.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",u.createElement(u.Fragment,null,u.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",u.createElement(u.Fragment,null,u.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",u.createElement(u.Fragment,null,u.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",u.createElement(u.Fragment,null,u.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),qi=new Map([["bold",u.createElement(u.Fragment,null,u.createElement("path",{d:"M128,128a12,12,0,0,1-12,12H48a12,12,0,0,1,0-24h68A12,12,0,0,1,128,128ZM48,76H180a12,12,0,0,0,0-24H48a12,12,0,0,0,0,24Zm52,104H48a12,12,0,0,0,0,24h52a12,12,0,0,0,0-24Zm132.49-20.49a12,12,0,0,0-17,0L196,179V112a12,12,0,0,0-24,0v67l-19.51-19.52a12,12,0,0,0-17,17l40,40a12,12,0,0,0,17,0l40-40A12,12,0,0,0,232.49,159.51Z"}))],["duotone",u.createElement(u.Fragment,null,u.createElement("path",{d:"M224,80v88l-24,24H48V64H208A16,16,0,0,1,224,80Z",opacity:"0.2"}),u.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["fill",u.createElement(u.Fragment,null,u.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,32ZM72,72h96a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16Zm40,112H72a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Zm8-48H72a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm77.66,29.66-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L160,164.69V120a8,8,0,0,1,16,0v44.69l10.34-10.35a8,8,0,0,1,11.32,11.32Z"}))],["light",u.createElement(u.Fragment,null,u.createElement("path",{d:"M126,128a6,6,0,0,1-6,6H48a6,6,0,0,1,0-12h72A6,6,0,0,1,126,128ZM48,70H184a6,6,0,0,0,0-12H48a6,6,0,0,0,0,12Zm56,116H48a6,6,0,0,0,0,12h56a6,6,0,0,0,0-12Zm124.24-22.24a6,6,0,0,0-8.48,0L190,193.51V112a6,6,0,0,0-12,0v81.51l-29.76-29.75a6,6,0,0,0-8.48,8.48l40,40a6,6,0,0,0,8.48,0l40-40A6,6,0,0,0,228.24,163.76Z"}))],["regular",u.createElement(u.Fragment,null,u.createElement("path",{d:"M128,128a8,8,0,0,1-8,8H48a8,8,0,0,1,0-16h72A8,8,0,0,1,128,128ZM48,72H184a8,8,0,0,0,0-16H48a8,8,0,0,0,0,16Zm56,112H48a8,8,0,0,0,0,16h56a8,8,0,0,0,0-16Zm125.66-21.66a8,8,0,0,0-11.32,0L192,188.69V112a8,8,0,0,0-16,0v76.69l-26.34-26.35a8,8,0,0,0-11.32,11.32l40,40a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,229.66,162.34Z"}))],["thin",u.createElement(u.Fragment,null,u.createElement("path",{d:"M124,128a4,4,0,0,1-4,4H48a4,4,0,0,1,0-8h72A4,4,0,0,1,124,128ZM48,68H184a4,4,0,0,0,0-8H48a4,4,0,0,0,0,8Zm56,120H48a4,4,0,0,0,0,8h56a4,4,0,0,0,0-8Zm122.83-22.83a4,4,0,0,0-5.66,0L188,198.34V112a4,4,0,0,0-8,0v86.34l-33.17-33.17a4,4,0,0,0-5.66,5.66l40,40a4,4,0,0,0,5.66,0l40-40A4,4,0,0,0,226.83,165.17Z"}))]]),Lr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Ui}));Lr.displayName="CalendarIcon";const Xi=Lr,Mr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Ki}));Mr.displayName="DotsSixVerticalIcon";const Yi=Mr,Ar=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Gi}));Ar.displayName="GridFourIcon";const Ir=Ar,Tr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:Wi}));Tr.displayName="PencilSimpleIcon";const Qi=Tr,Dr=u.forwardRef((e,t)=>u.createElement(Et,{ref:t,...e,weights:qi}));Dr.displayName="SortAscendingIcon";const Ji=Dr,Wn="/login",ec="/api/auth/";let Do=!1;const tc=e=>{const t=`${e.pathname||"/"}${e.search}${e.hash}`;return`${Wn}?next=${encodeURIComponent(t)}`},nc=e=>{if(!Ge.isAxiosError(e)||e.response?.status!==401)return!1;const t=e.config?.url??"";return!t.startsWith(ec)&&t!==Wn},Nr=(e=window.location)=>{Do||e.pathname===Wn||(Do=!0,e.assign(tc(e)))},oc="X-Ocean-Brain-Session-Generation";let No=!1,kt;const rc=e=>!!(e.authRequired&&!e.authenticated),sc=e=>{const t=e.headers.get(oc);return t?kt?kt===t?!1:(kt=t,!0):(kt=t,!1):!1},ac=(e=window.location)=>{No||(No=!0,e.reload())},Xt=async(e=fetch)=>{const t=await e("/api/auth/session").catch(()=>{});if(!t?.ok)return"unavailable";const n=sc(t),o=await t.json();return rc(o)?(Nr(),"expired"):n?(ac(),"reloading"):"active"},ic=e=>t=>{if(!(t instanceof MessageEvent)||typeof t.data!="string")return;const n=Es(t.data);!n||n.type!==e||Cs(n)},cc=()=>{const e=Vn();return u.useEffect(()=>Ss(t=>{Ps(e,t)}),[e]),u.useEffect(()=>{if(typeof EventSource>"u")return;const t=new EventSource("/api/events");let n=!1;const o=()=>{n=!0,Xt()},r=()=>{n&&(n=!1,Xt())},s=Rs.map(a=>{const i=ic(a);return t.addEventListener(a,i),()=>{t.removeEventListener(a,i)}});return t.addEventListener("error",o),t.addEventListener("open",r),()=>{s.forEach(a=>{a()}),t.removeEventListener("error",o),t.removeEventListener("open",r),t.close()}},[]),null},lc=({children:e})=>p.jsx(ra,{client:sa,children:p.jsx(aa,{children:p.jsxs(ia,{children:[p.jsx(cc,{}),e]})})}),jo=({children:e,fallback:t})=>e||t;function uc({itemsPerPage:e,onItemsPerPageChange:t,sortBy:n,onSortByChange:o,sortOrder:r,onSortOrderChange:s,pinnedFirst:a,onPinnedFirstChange:i}){return p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ir,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(te,{id:"note-filters-items-label",as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Items"}),p.jsx(vn,{value:String(e),"aria-labelledby":"note-filters-items-label",onValueChange:l=>{const c=Number(l);ca(c)&&t(c)},variant:"ghost",size:"sm",children:tr.map(l=>p.jsx(it,{value:String(l),children:l===nr?`Default (${l})`:l},l))})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ji,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),p.jsx(te,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Sort"}),p.jsxs(vn,{value:n,ariaLabel:"Sort field",onValueChange:l=>o(l),variant:"ghost",size:"sm",children:[p.jsx(it,{value:"updatedAt",children:"Updated"}),p.jsx(it,{value:"createdAt",children:"Created"})]}),p.jsxs(vn,{value:r,ariaLabel:"Sort order",onValueChange:l=>s(l),variant:"ghost",size:"sm",children:[p.jsx(it,{value:"desc",children:"Newest"}),p.jsx(it,{value:"asc",children:"Oldest"})]})]}),p.jsx("div",{className:"h-5 w-px bg-divider"}),p.jsxs(la,{htmlFor:"pinnedFirst",size:"sm",className:"flex cursor-pointer items-center gap-1.5",children:[p.jsx(ua,{id:"pinnedFirst",size:"sm",checked:a,onChange:l=>i(l.target.checked)}),p.jsx(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Pinned First"})]})]})})}const dc=e=>{let t=!1;return()=>{t||(window.requestAnimationFrame(()=>{e(),t=!1}),t=!0)}},yn=new Map;function hc(){const e=rn({select:n=>n.pathname}),t=u.useRef(null);return u.useEffect(()=>{if(t.current?.parentElement){const{parentElement:n}=t.current,o=s=>{if(s!==0){yn.set(e,s);return}yn.delete(e)},r=dc(()=>{if(t.current){const{scrollTop:s}=n;o(s)}});return n.scrollTop=yn.get(e)??0,n.addEventListener("scroll",r),()=>{n.removeEventListener("scroll",r)}}},[e]),p.jsx("div",{ref:t,className:"hidden"})}const fc=()=>null,pc=e=>e instanceof Element?e instanceof HTMLElement&&(e.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(e.tagName))?!0:!!e.closest('button, [role="button"], [role="dialog"], [role="menu"], [role="menuitem"], [role="listbox"]'):!1,mc=()=>{const e=On();return u.useEffect(()=>{const t=n=>{n.defaultPrevented||!(n.metaKey||n.ctrlKey)||n.key.toLowerCase()!=="k"||pc(n.target)||(n.preventDefault(),e({to:Ct,search:{query:"",page:1,mode:"hybrid"}}))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),null},gc="flex h-dvh min-h-0 w-full flex-row overflow-hidden",vc=ae("fixed","bottom-4","left-4","z-[1003]","flex","h-12","w-12","items-center","justify-center","rounded-[14px]","border","border-border-subtle","bg-surface","text-fg-secondary","shadow-[0_12px_24px_-18px_rgba(0,0,0,0.35)]","transition-all","hover:bg-hover-subtle","hover:text-fg-default","active:translate-y-px","aria-expanded:bg-hover-subtle","aria-expanded:text-fg-default"),bc=ae("fixed","z-[1002]","h-full","w-full","flex-[0_0_300px]","overflow-y-auto","border-r-0","border-border-subtle","bg-[var(--page-bg)]","pb-20","md:static","md:w-auto","md:translate-x-0","md:border-r","md:pb-0","md:pointer-events-auto"),yc="pointer-events-none -translate-x-full",xc="pointer-events-auto translate-x-0",wc=ae("flex","h-full","min-h-0","min-w-0","flex-1","flex-col","overflow-x-hidden","overflow-y-auto","overscroll-contain","[scrollbar-gutter:stable]"),Sc=ae("sticky","top-0","z-[1001]","border-b","border-border-subtle","bg-[var(--page-bg)]","max-md:after:content-['']","max-md:after:pointer-events-none","max-md:after:absolute","max-md:after:inset-y-0","max-md:after:right-0","max-md:after:w-12","max-md:after:bg-[linear-gradient(to_right,transparent,var(--page-bg))]"),Rc=ae("flex","items-center","overflow-x-auto","whitespace-nowrap","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden"),Ec=ae("min-h-0","min-w-0","max-w-full","flex-1","overflow-x-clip","px-4","pt-4","after:block","after:h-4","after:content-['']","max-md:after:h-24"),Cc=({sidebar:e,topNavigation:t,children:n})=>{const o=rn({select:i=>i.pathname}),[r,s]=u.useState(!1),a="site-layout-sidebar";return u.useEffect(()=>{s(!1)},[o]),p.jsxs("div",{className:gc,children:[p.jsx(mc,{}),p.jsx("div",{className:"md:hidden",children:p.jsx("button",{type:"button",className:vc,"aria-label":"Toggle sidebar","aria-controls":a,"aria-expanded":r,onClick:()=>s(i=>!i),children:p.jsx(_s,{className:"h-6 w-6"})})}),p.jsx("aside",{id:a,className:ae(bc,r?xc:yc),children:e}),p.jsxs("main",{className:wc,children:[p.jsx("div",{className:Sc,children:p.jsx("div",{className:Rc,children:t})}),p.jsx("div",{className:Ec,children:n}),p.jsx(hc,{})]})]})},jr=e=>typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string",Or=(e,t)=>({type:"error",category:"graphql",errors:[{code:"INVALID_RESPONSE_SHAPE",message:`GraphQL response field "${e}" is missing or invalid`,details:t}]}),Pc=async e=>{try{const t=await Fn(`
|
|
3
|
+
query GetServerCache($key: String!) {
|
|
4
|
+
cache(key: $key) {
|
|
5
|
+
value
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`,{key:e});if(t.type==="error")throw t;if(!jr(t.cache))throw Or("cache",t);return t.cache.value}catch{return""}},_c=async(e,t)=>{const n=await Fn(`
|
|
9
|
+
mutation SetServerCache($key: String!, $value: String!) {
|
|
10
|
+
setCache(key: $key, value: $value) {
|
|
11
|
+
value
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,{key:e,value:encodeURIComponent(t)});return n.type==="error"?n:jr(n.setCache)?{...n,setCache:n.setCache}:Or("setCache",n)},Lc=()=>{const e=Ls(),t=ha(),n=Vn(),{data:o}=Ms({queryKey:bt.ui.heroBanner(),async queryFn(){return Pc("heroBanner")}});return o?p.jsx("div",{className:"p-3 pb-0",children:p.jsxs("div",{className:"surface-base group relative overflow-hidden",children:[p.jsx("img",{alt:"Studio atmosphere banner",className:"w-full object-cover transition duration-500 group-hover:scale-[1.01] group-hover:opacity-90 dark:brightness-[0.85] dark:saturate-[0.9]",src:o}),p.jsx("button",{type:"button","aria-label":"Remove sidebar banner",title:"Remove banner",className:"focus-ring-soft absolute right-2 top-2 inline-flex h-8 w-8 items-center justify-center rounded-[10px] border border-white/14 bg-black/24 text-white/85 opacity-0 outline-none backdrop-blur-sm transition-opacity hover:bg-black/34 hover:text-white focus-visible:opacity-100 group-hover:opacity-100",onClick:async()=>{if(await e("Remove this hero banner from the sidebar?")){const r=await _c("heroBanner","");if(r.type==="error"){t(r.errors[0]?.message??"Failed to remove hero banner");return}await n.invalidateQueries({queryKey:bt.ui.heroBanner(),exact:!0})}},children:p.jsx(da,{className:"h-4 w-4",weight:"bold"})})]})}):null};function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>o=>{t.forEach(r=>r(o))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function qn(e){return"nodeType"in e}function X(e){var t,n;return e?qe(e)?e:qn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Xn(e){const{Document:t}=X(e);return e instanceof t}function Pt(e){return qe(e)?!1:e instanceof X(e).HTMLElement}function kr(e){return e instanceof X(e).SVGElement}function Xe(e){return e?qe(e)?e.document:qn(e)?Xn(e)?e:Pt(e)||kr(e)?e.ownerDocument:document:document:document}const pe=sn?u.useLayoutEffect:u.useEffect;function Yn(e){const t=u.useRef(e);return pe(()=>{t.current=e}),u.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Ac(){const e=u.useRef(null),t=u.useCallback((o,r)=>{e.current=setInterval(o,r)},[]),n=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yt(e,t){t===void 0&&(t=[e]);const n=u.useRef(e);return pe(()=>{n.current!==e&&(n.current=e)},t),n}function _t(e,t){const n=u.useRef();return u.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function Yt(e){const t=Yn(e),n=u.useRef(null),o=u.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function In(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}let xn={};function Lt(e,t){return u.useMemo(()=>{if(t)return t;const n=xn[e]==null?0:xn[e]+1;return xn[e]=n,e+"-"+n},[e,t])}function Vr(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((s,a)=>{const i=Object.entries(a);for(const[l,c]of i){const d=s[l];d!=null&&(s[l]=d+e*c)}return s},{...t})}}const Ue=Vr(1),xt=Vr(-1);function Ic(e){return"clientX"in e&&"clientY"in e}function Qn(e){if(!e)return!1;const{KeyboardEvent:t}=X(e.target);return t&&e instanceof t}function Tc(e){if(!e)return!1;const{TouchEvent:t}=X(e.target);return t&&e instanceof t}function Tn(e){if(Tc(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Ic(e)?{x:e.clientX,y:e.clientY}:null}const wt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[wt.Translate.toString(e),wt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Oo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Dc(e){return e.matches(Oo)?e:e.querySelector(Oo)}const Nc={display:"none"};function jc(e){let{id:t,value:n}=e;return K.createElement("div",{id:t,style:Nc},n)}function Oc(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return K.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function kc(){const[e,t]=u.useState("");return{announce:u.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const Fr=u.createContext(null);function Vc(e){const t=u.useContext(Fr);u.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Fc(){const[e]=u.useState(()=>new Set),t=u.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[u.useCallback(o=>{let{type:r,event:s}=o;e.forEach(a=>{var i;return(i=a[r])==null?void 0:i.call(a,s)})},[e]),t]}const Hc={draggable:`
|
|
15
|
+
To pick up a draggable item, press the space bar.
|
|
16
|
+
While dragging, use the arrow keys to move the item.
|
|
17
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
18
|
+
`},Bc={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Zc(e){let{announcements:t=Bc,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=Hc}=e;const{announce:s,announcement:a}=kc(),i=Lt("DndLiveRegion"),[l,c]=u.useState(!1);if(u.useEffect(()=>{c(!0)},[]),Vc(u.useMemo(()=>({onDragStart(h){let{active:f}=h;s(t.onDragStart({active:f}))},onDragMove(h){let{active:f,over:m}=h;t.onDragMove&&s(t.onDragMove({active:f,over:m}))},onDragOver(h){let{active:f,over:m}=h;s(t.onDragOver({active:f,over:m}))},onDragEnd(h){let{active:f,over:m}=h;s(t.onDragEnd({active:f,over:m}))},onDragCancel(h){let{active:f,over:m}=h;s(t.onDragCancel({active:f,over:m}))}}),[s,t])),!l)return null;const d=K.createElement(K.Fragment,null,K.createElement(jc,{id:o,value:r.draggable}),K.createElement(Oc,{id:i,announcement:a}));return n?lt.createPortal(d,n):d}var j;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(j||(j={}));function Qt(){}function ko(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const ie=Object.freeze({x:0,y:0});function Hr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Br(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function zc(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Vo(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function Zr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Fo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Uc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Fo(t,t.left,t.top),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Hr(Fo(l),r);s.push({id:i,data:{droppableContainer:a,value:c}})}}return s.sort(Br)},Kc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Vo(t),s=[];for(const a of o){const{id:i}=a,l=n.get(i);if(l){const c=Vo(l),d=r.reduce((f,m,g)=>f+Hr(c[g],m),0),h=Number((d/4).toFixed(4));s.push({id:i,data:{droppableContainer:a,value:h}})}}return s.sort(Br)};function Gc(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=r-o,i=s-n;if(o<r&&n<s){const l=t.width*t.height,c=e.width*e.height,d=a*i,h=d/(l+c-d);return Number(h.toFixed(4))}return 0}const Wc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const s of o){const{id:a}=s,i=n.get(a);if(i){const l=Gc(i,t);l>0&&r.push({id:a,data:{droppableContainer:s,value:l}})}}return r.sort(zc)};function qc(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function $r(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ie}function Xc(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),s=1;s<o;s++)r[s-1]=arguments[s];return r.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...n})}}const Yc=Xc(1);function Qc(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Jc(e,t,n){const o=Qc(t);if(!o)return e;const{scaleX:r,scaleY:s,x:a,y:i}=o,l=e.left-a-(1-r)*parseFloat(n),c=e.top-i-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,h=s?e.height/s:e.height;return{width:d,height:h,top:c,right:l+d,bottom:c+h,left:l}}const el={ignoreTransform:!1};function Ye(e,t){t===void 0&&(t=el);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=X(e).getComputedStyle(e);c&&(n=Jc(n,c,d))}const{top:o,left:r,width:s,height:a,bottom:i,right:l}=n;return{top:o,left:r,width:s,height:a,bottom:i,right:l}}function Ho(e){return Ye(e,{ignoreTransform:!0})}function tl(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function nl(e,t){return t===void 0&&(t=X(e).getComputedStyle(e)),t.position==="fixed"}function ol(e,t){t===void 0&&(t=X(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const s=t[r];return typeof s=="string"?n.test(s):!1})}function an(e,t){const n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(Xn(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Pt(r)||kr(r)||n.includes(r))return n;const s=X(e).getComputedStyle(r);return r!==e&&ol(r,s)&&n.push(r),nl(r,s)?n:o(r.parentNode)}return e?o(e):n}function zr(e){const[t]=an(e,1);return t??null}function wn(e){return!sn||!e?null:qe(e)?e:qn(e)?Xn(e)||e===Xe(e).scrollingElement?window:Pt(e)?e:null:null}function Ur(e){return qe(e)?e.scrollX:e.scrollLeft}function Kr(e){return qe(e)?e.scrollY:e.scrollTop}function Dn(e){return{x:Ur(e),y:Kr(e)}}var F;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(F||(F={}));function Gr(e){return!sn||!e?!1:e===document.scrollingElement}function Wr(e){const t={x:0,y:0},n=Gr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=o.y,i=e.scrollLeft>=o.x;return{isTop:r,isLeft:s,isBottom:a,isRight:i,maxScroll:o,minScroll:t}}const rl={x:.2,y:.2};function sl(e,t,n,o,r){let{top:s,left:a,right:i,bottom:l}=n;o===void 0&&(o=10),r===void 0&&(r=rl);const{isTop:c,isBottom:d,isLeft:h,isRight:f}=Wr(e),m={x:0,y:0},g={x:0,y:0},v={height:t.height*r.y,width:t.width*r.x};return!c&&s<=t.top+v.height?(m.y=F.Backward,g.y=o*Math.abs((t.top+v.height-s)/v.height)):!d&&l>=t.bottom-v.height&&(m.y=F.Forward,g.y=o*Math.abs((t.bottom-v.height-l)/v.height)),!f&&i>=t.right-v.width?(m.x=F.Forward,g.x=o*Math.abs((t.right-v.width-i)/v.width)):!h&&a<=t.left+v.width&&(m.x=F.Backward,g.x=o*Math.abs((t.left+v.width-a)/v.width)),{direction:m,speed:g}}function al(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function qr(e){return e.reduce((t,n)=>Ue(t,Dn(n)),ie)}function il(e){return e.reduce((t,n)=>t+Ur(n),0)}function cl(e){return e.reduce((t,n)=>t+Kr(n),0)}function ll(e,t){if(t===void 0&&(t=Ye),!e)return;const{top:n,left:o,bottom:r,right:s}=t(e);zr(e)&&(r<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ul=[["x",["left","right"],il],["y",["top","bottom"],cl]];class Jn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=an(n),r=qr(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,i]of ul)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=i(o),d=r[s]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ft{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function dl(e){const{EventTarget:t}=X(e);return e instanceof t?e:Xe(e)}function Sn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function Bo(e){e.preventDefault()}function hl(e){e.stopPropagation()}var A;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(A||(A={}));const Xr={start:[A.Space,A.Enter],cancel:[A.Esc],end:[A.Space,A.Enter,A.Tab]},fl=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case A.Right:return{...n,x:n.x+25};case A.Left:return{...n,x:n.x-25};case A.Down:return{...n,y:n.y+25};case A.Up:return{...n,y:n.y-25}}};class eo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ft(Xe(n)),this.windowListeners=new ft(X(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&ll(o),n(ie)}handleKeyDown(t){if(Qn(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:s=Xr,coordinateGetter:a=fl,scrollBehavior:i="smooth"}=r,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=o.current,d=c?{x:c.left,y:c.top}:ie;this.referenceCoordinates||(this.referenceCoordinates=d);const h=a(t,{active:n,context:o.current,currentCoordinates:d});if(h){const f=xt(h,d),m={x:0,y:0},{scrollableAncestors:g}=o.current;for(const v of g){const b=t.code,{isTop:y,isRight:w,isLeft:R,isBottom:S,maxScroll:P,minScroll:L}=Wr(v),E=al(v),x={x:Math.min(b===A.Right?E.right-E.width/2:E.right,Math.max(b===A.Right?E.left:E.left+E.width/2,h.x)),y:Math.min(b===A.Down?E.bottom-E.height/2:E.bottom,Math.max(b===A.Down?E.top:E.top+E.height/2,h.y))},C=b===A.Right&&!w||b===A.Left&&!R,I=b===A.Down&&!S||b===A.Up&&!y;if(C&&x.x!==h.x){const _=v.scrollLeft+f.x,M=b===A.Right&&_<=P.x||b===A.Left&&_>=L.x;if(M&&!f.y){v.scrollTo({left:_,behavior:i});return}M?m.x=v.scrollLeft-_:m.x=b===A.Right?v.scrollLeft-P.x:v.scrollLeft-L.x,m.x&&v.scrollBy({left:-m.x,behavior:i});break}else if(I&&x.y!==h.y){const _=v.scrollTop+f.y,M=b===A.Down&&_<=P.y||b===A.Up&&_>=L.y;if(M&&!f.x){v.scrollTo({top:_,behavior:i});return}M?m.y=v.scrollTop-_:m.y=b===A.Down?v.scrollTop-P.y:v.scrollTop-L.y,m.y&&v.scrollBy({top:-m.y,behavior:i});break}}this.handleMove(t,Ue(xt(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}eo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Xr,onActivation:r}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const i=s.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function Zo(e){return!!(e&&"distance"in e)}function $o(e){return!!(e&&"delay"in e)}class to{constructor(t,n,o){var r;o===void 0&&(o=dl(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Xe(a),this.documentListeners=new ft(this.document),this.listeners=new ft(o),this.windowListeners=new ft(X(a)),this.initialCoordinates=(r=Tn(s))!=null?r:ie,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,Bo),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,Bo),this.documentListeners.add(re.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($o(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Zo(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(re.Click,hl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:s}=this,{onMove:a,options:{activationConstraint:i}}=s;if(!r)return;const l=(n=Tn(t))!=null?n:ie,c=xt(r,l);if(!o&&i){if(Zo(i)){if(i.tolerance!=null&&Sn(c,i.tolerance))return this.handleCancel();if(Sn(c,i.distance))return this.handleStart()}if($o(i)&&Sn(c,i.tolerance))return this.handleCancel();this.handlePending(i,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===A.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const pl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class no extends to{constructor(t){const{event:n}=t,o=Xe(n.target);super(t,pl,o)}}no.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];const ml={move:{name:"mousemove"},end:{name:"mouseup"}};var Nn;(function(e){e[e.RightClick=2]="RightClick"})(Nn||(Nn={}));class gl extends to{constructor(t){super(t,ml,Xe(t.event.target))}}gl.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===Nn.RightClick?!1:(o?.({event:n}),!0)}}];const Rn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class vl extends to{constructor(t){super(t,Rn)}static setup(){return window.addEventListener(Rn.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Rn.move.name,t)};function t(){}}}vl.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var pt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(pt||(pt={}));var Jt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Jt||(Jt={}));function bl(e){let{acceleration:t,activator:n=pt.Pointer,canScroll:o,draggingRect:r,enabled:s,interval:a=5,order:i=Jt.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:h,threshold:f}=e;const m=xl({delta:h,disabled:!s}),[g,v]=Ac(),b=u.useRef({x:0,y:0}),y=u.useRef({x:0,y:0}),w=u.useMemo(()=>{switch(n){case pt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case pt.DraggableRect:return r}},[n,r,l]),R=u.useRef(null),S=u.useCallback(()=>{const L=R.current;if(!L)return;const E=b.current.x*y.current.x,x=b.current.y*y.current.y;L.scrollBy(E,x)},[]),P=u.useMemo(()=>i===Jt.TreeOrder?[...c].reverse():c,[i,c]);u.useEffect(()=>{if(!s||!c.length||!w){v();return}for(const L of P){if(o?.(L)===!1)continue;const E=c.indexOf(L),x=d[E];if(!x)continue;const{direction:C,speed:I}=sl(L,x,w,t,f);for(const _ of["x","y"])m[_][C[_]]||(I[_]=0,C[_]=0);if(I.x>0||I.y>0){v(),R.current=L,g(S,a),b.current=I,y.current=C;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,S,o,v,s,a,JSON.stringify(w),JSON.stringify(m),g,c,P,d,JSON.stringify(f)])}const yl={x:{[F.Backward]:!1,[F.Forward]:!1},y:{[F.Backward]:!1,[F.Forward]:!1}};function xl(e){let{delta:t,disabled:n}=e;const o=In(t);return _t(r=>{if(n||!o||!r)return yl;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[F.Backward]:r.x[F.Backward]||s.x===-1,[F.Forward]:r.x[F.Forward]||s.x===1},y:{[F.Backward]:r.y[F.Backward]||s.y===-1,[F.Forward]:r.y[F.Forward]||s.y===1}}},[n,t,o])}function wl(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return _t(r=>{var s;return t==null?null:(s=o??r)!=null?s:null},[o,t])}function Sl(e,t){return u.useMemo(()=>e.reduce((n,o)=>{const{sensor:r}=o,s=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,o)}));return[...n,...s]},[]),[e,t])}var St;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(St||(St={}));var jn;(function(e){e.Optimized="optimized"})(jn||(jn={}));const zo=new Map;function Rl(e,t){let{dragging:n,dependencies:o,config:r}=t;const[s,a]=u.useState(null),{frequency:i,measure:l,strategy:c}=r,d=u.useRef(e),h=b(),f=yt(h),m=u.useCallback(function(y){y===void 0&&(y=[]),!f.current&&a(w=>w===null?y:w.concat(y.filter(R=>!w.includes(R))))},[f]),g=u.useRef(null),v=_t(y=>{if(h&&!n)return zo;if(!y||y===zo||d.current!==e||s!=null){const w=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){w.set(R.id,R.rect.current);continue}const S=R.node.current,P=S?new Jn(l(S),S):null;R.rect.current=P,P&&w.set(R.id,P)}return w}return y},[e,s,n,h,l]);return u.useEffect(()=>{d.current=e},[e]),u.useEffect(()=>{h||m()},[n,h]),u.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),u.useEffect(()=>{h||typeof i!="number"||g.current!==null||(g.current=setTimeout(()=>{m(),g.current=null},i))},[i,h,m,...o]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:s!=null};function b(){switch(c){case St.Always:return!1;case St.BeforeDragging:return n;default:return!n}}}function Yr(e,t){return _t(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function El(e,t){return Yr(e,t)}function Cl(e){let{callback:t,disabled:n}=e;const o=Yn(t),r=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function cn(e){let{callback:t,disabled:n}=e;const o=Yn(t),r=u.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function Pl(e){return new Jn(Ye(e),e)}function Uo(e,t,n){t===void 0&&(t=Pl);const[o,r]=u.useState(null);function s(){r(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=Cl({callback(l){if(e)for(const c of l){const{type:d,target:h}=c;if(d==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),i=cn({callback:s});return pe(()=>{s(),e?(i?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(i?.disconnect(),a?.disconnect())},[e]),o}function _l(e){const t=Yr(e);return $r(e,t)}const Ko=[];function Ll(e){const t=u.useRef(e),n=_t(o=>e?o&&o!==Ko&&e&&t.current&&e.parentNode===t.current.parentNode?o:an(e):Ko,[e]);return u.useEffect(()=>{t.current=e},[e]),n}function Ml(e){const[t,n]=u.useState(null),o=u.useRef(e),r=u.useCallback(s=>{const a=wn(s.target);a&&n(i=>i?(i.set(a,Dn(a)),new Map(i)):null)},[]);return u.useEffect(()=>{const s=o.current;if(e!==s){a(s);const i=e.map(l=>{const c=wn(l);return c?(c.addEventListener("scroll",r,{passive:!0}),[c,Dn(c)]):null}).filter(l=>l!=null);n(i.length?new Map(i):null),o.current=e}return()=>{a(e),a(s)};function a(i){i.forEach(l=>{const c=wn(l);c?.removeEventListener("scroll",r)})}},[r,e]),u.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Ue(s,a),ie):qr(e):ie,[e,t])}function Go(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const o=e!==ie;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):ie}function Al(e){u.useEffect(()=>{if(!sn)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Il(e,t){return u.useMemo(()=>e.reduce((n,o)=>{let{eventName:r,handler:s}=o;return n[r]=a=>{s(a,t)},n},{}),[e,t])}function Qr(e){return u.useMemo(()=>e?tl(e):null,[e])}const Wo=[];function Tl(e,t){t===void 0&&(t=Ye);const[n]=e,o=Qr(n?X(n):null),[r,s]=u.useState(Wo);function a(){s(()=>e.length?e.map(l=>Gr(l)?o:new Jn(t(l),l)):Wo)}const i=cn({callback:a});return pe(()=>{i?.disconnect(),a(),e.forEach(l=>i?.observe(l))},[e]),r}function Dl(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pt(t)?t:e}function Nl(e){let{measure:t}=e;const[n,o]=u.useState(null),r=u.useCallback(c=>{for(const{target:d}of c)if(Pt(d)){o(h=>{const f=t(d);return h?{...h,width:f.width,height:f.height}:f});break}},[t]),s=cn({callback:r}),a=u.useCallback(c=>{const d=Dl(c);s?.disconnect(),d&&s?.observe(d),o(d?t(d):null)},[t,s]),[i,l]=Yt(a);return u.useMemo(()=>({nodeRef:i,rect:n,setRef:l}),[n,i,l])}const jl=[{sensor:no,options:{}},{sensor:eo,options:{}}],Ol={current:{}},$t={draggable:{measure:Ho},droppable:{measure:Ho,strategy:St.WhileDragging,frequency:jn.Optimized},dragOverlay:{measure:Ye}};class mt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const kl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$t,measureDroppableContainers:Qt,windowRect:null,measuringScheduled:!1},Vl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qt,draggableNodes:new Map,over:null,measureDroppableContainers:Qt},ln=u.createContext(Vl),Jr=u.createContext(kl);function Fl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mt}}}function Hl(e,t){switch(t.type){case j.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case j.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case j.DragEnd:case j.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case j.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new mt(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case j.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,s=e.droppable.containers.get(n);if(!s||o!==s.key)return e;const a=new mt(e.droppable.containers);return a.set(n,{...s,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case j.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const s=new mt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Bl(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(ln),s=In(o),a=In(n?.id);return u.useEffect(()=>{if(!t&&!o&&s&&a!=null){if(!Qn(s)||document.activeElement===s.target)return;const i=r.get(a);if(!i)return;const{activatorNode:l,node:c}=i;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const h=Dc(d);if(h){h.focus();break}}})}},[o,t,r,a,s]),null}function Zl(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,s)=>s({transform:r,...o}),n):n}function $l(e){return u.useMemo(()=>({draggable:{...$t.draggable,...e?.draggable},droppable:{...$t.droppable,...e?.droppable},dragOverlay:{...$t.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function zl(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const s=u.useRef(!1),{x:a,y:i}=typeof r=="boolean"?{x:r,y:r}:r;pe(()=>{if(!a&&!i||!t){s.current=!1;return}if(s.current||!o)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),h=$r(d,o);if(a||(h.x=0),i||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const f=zr(c);f&&f.scrollBy({top:h.y,left:h.x})}},[t,a,i,o,n])}const es=u.createContext({...ie,scaleX:1,scaleY:1});var Le;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Le||(Le={}));const Ul=u.memo(function(t){var n,o,r,s;let{id:a,accessibility:i,autoScroll:l=!0,children:c,sensors:d=jl,collisionDetection:h=Wc,measuring:f,modifiers:m,...g}=t;const v=u.useReducer(Hl,void 0,Fl),[b,y]=v,[w,R]=Fc(),[S,P]=u.useState(Le.Uninitialized),L=S===Le.Initialized,{draggable:{active:E,nodes:x,translate:C},droppable:{containers:I}}=b,_=E!=null?x.get(E):null,M=u.useRef({initial:null,translated:null}),U=u.useMemo(()=>{var z;return E!=null?{id:E,data:(z=_?.data)!=null?z:Ol,rect:M}:null},[E,_]),D=u.useRef(null),[ce,G]=u.useState(null),[V,Mt]=u.useState(null),me=yt(g,Object.values(g)),Je=Lt("DndDescribedBy",a),At=u.useMemo(()=>I.getEnabled(),[I]),W=$l(f),{droppableRects:ge,measureDroppableContainers:Te,measuringScheduled:et}=Rl(At,{dragging:L,dependencies:[C.x,C.y],config:W.droppable}),ne=wl(x,E),It=u.useMemo(()=>V?Tn(V):null,[V]),Se=ws(),ve=El(ne,W.draggable.measure);zl({activeNode:E!=null?x.get(E):null,config:Se.layoutShiftCompensation,initialRect:ve,measure:W.draggable.measure});const T=Uo(ne,W.draggable.measure,ve),tt=Uo(ne?ne.parentElement:null),le=u.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:ge,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),je=I.getNodeFor((n=le.current.over)==null?void 0:n.id),be=Nl({measure:W.dragOverlay.measure}),Oe=(o=be.nodeRef.current)!=null?o:ne,ke=L?(r=be.rect)!=null?r:T:null,oo=!!(be.nodeRef.current&&be.rect),ro=_l(oo?null:T),hn=Qr(Oe?X(Oe):null),Re=Ll(L?je??ne:null),Tt=Tl(Re),Dt=Zl(m,{transform:{x:C.x-ro.x,y:C.y-ro.y,scaleX:1,scaleY:1},activatorEvent:V,active:U,activeNodeRect:T,containerNodeRect:tt,draggingNodeRect:ke,over:le.current.over,overlayNodeRect:be.rect,scrollableAncestors:Re,scrollableAncestorRects:Tt,windowRect:hn}),so=It?Ue(It,C):null,ao=Ml(Re),ps=Go(ao),ms=Go(ao,[T]),Ve=Ue(Dt,ps),Fe=ke?Yc(ke,Dt):null,nt=U&&Fe?h({active:U,collisionRect:Fe,droppableRects:ge,droppableContainers:At,pointerCoordinates:so}):null,io=Zr(nt,"id"),[Ee,co]=u.useState(null),gs=oo?Dt:Ue(Dt,ms),vs=qc(gs,(s=Ee?.rect)!=null?s:null,T),fn=u.useRef(null),lo=u.useCallback((z,Y)=>{let{sensor:Q,options:Ce}=Y;if(D.current==null)return;const oe=x.get(D.current);if(!oe)return;const J=z.nativeEvent,ue=new Q({active:D.current,activeNode:oe,event:J,options:Ce,context:le,onAbort(B){if(!x.get(B))return;const{onDragAbort:de}=me.current,ye={id:B};de?.(ye),w({type:"onDragAbort",event:ye})},onPending(B,Pe,de,ye){if(!x.get(B))return;const{onDragPending:rt}=me.current,_e={id:B,constraint:Pe,initialCoordinates:de,offset:ye};rt?.(_e),w({type:"onDragPending",event:_e})},onStart(B){const Pe=D.current;if(Pe==null)return;const de=x.get(Pe);if(!de)return;const{onDragStart:ye}=me.current,ot={activatorEvent:J,active:{id:Pe,data:de.data,rect:M}};lt.unstable_batchedUpdates(()=>{ye?.(ot),P(Le.Initializing),y({type:j.DragStart,initialCoordinates:B,active:Pe}),w({type:"onDragStart",event:ot}),G(fn.current),Mt(J)})},onMove(B){y({type:j.DragMove,coordinates:B})},onEnd:He(j.DragEnd),onCancel:He(j.DragCancel)});fn.current=ue;function He(B){return async function(){const{active:de,collisions:ye,over:ot,scrollAdjustedTranslate:rt}=le.current;let _e=null;if(de&&rt){const{cancelDrop:st}=me.current;_e={activatorEvent:J,active:de,collisions:ye,delta:rt,over:ot},B===j.DragEnd&&typeof st=="function"&&await Promise.resolve(st(_e))&&(B=j.DragCancel)}D.current=null,lt.unstable_batchedUpdates(()=>{y({type:B}),P(Le.Uninitialized),co(null),G(null),Mt(null),fn.current=null;const st=B===j.DragEnd?"onDragEnd":"onDragCancel";if(_e){const pn=me.current[st];pn?.(_e),w({type:st,event:_e})}})}}},[x]),bs=u.useCallback((z,Y)=>(Q,Ce)=>{const oe=Q.nativeEvent,J=x.get(Ce);if(D.current!==null||!J||oe.dndKit||oe.defaultPrevented)return;const ue={active:J};z(Q,Y.options,ue)===!0&&(oe.dndKit={capturedBy:Y.sensor},D.current=Ce,lo(Q,Y))},[x,lo]),uo=Sl(d,bs);Al(d),pe(()=>{T&&S===Le.Initializing&&P(Le.Initialized)},[T,S]),u.useEffect(()=>{const{onDragMove:z}=me.current,{active:Y,activatorEvent:Q,collisions:Ce,over:oe}=le.current;if(!Y||!Q)return;const J={active:Y,activatorEvent:Q,collisions:Ce,delta:{x:Ve.x,y:Ve.y},over:oe};lt.unstable_batchedUpdates(()=>{z?.(J),w({type:"onDragMove",event:J})})},[Ve.x,Ve.y]),u.useEffect(()=>{const{active:z,activatorEvent:Y,collisions:Q,droppableContainers:Ce,scrollAdjustedTranslate:oe}=le.current;if(!z||D.current==null||!Y||!oe)return;const{onDragOver:J}=me.current,ue=Ce.get(io),He=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,B={active:z,activatorEvent:Y,collisions:Q,delta:{x:oe.x,y:oe.y},over:He};lt.unstable_batchedUpdates(()=>{co(He),J?.(B),w({type:"onDragOver",event:B})})},[io]),pe(()=>{le.current={activatorEvent:V,active:U,activeNode:ne,collisionRect:Fe,collisions:nt,droppableRects:ge,draggableNodes:x,draggingNode:Oe,draggingNodeRect:ke,droppableContainers:I,over:Ee,scrollableAncestors:Re,scrollAdjustedTranslate:Ve},M.current={initial:ke,translated:Fe}},[U,ne,nt,Fe,x,Oe,ke,ge,I,Ee,Re,Ve]),bl({...Se,delta:C,draggingRect:Fe,pointerCoordinates:so,scrollableAncestors:Re,scrollableAncestorRects:Tt});const ys=u.useMemo(()=>({active:U,activeNode:ne,activeNodeRect:T,activatorEvent:V,collisions:nt,containerNodeRect:tt,dragOverlay:be,draggableNodes:x,droppableContainers:I,droppableRects:ge,over:Ee,measureDroppableContainers:Te,scrollableAncestors:Re,scrollableAncestorRects:Tt,measuringConfiguration:W,measuringScheduled:et,windowRect:hn}),[U,ne,T,V,nt,tt,be,x,I,ge,Ee,Te,Re,Tt,W,et,hn]),xs=u.useMemo(()=>({activatorEvent:V,activators:uo,active:U,activeNodeRect:T,ariaDescribedById:{draggable:Je},dispatch:y,draggableNodes:x,over:Ee,measureDroppableContainers:Te}),[V,uo,U,T,y,Je,x,Ee,Te]);return K.createElement(Fr.Provider,{value:R},K.createElement(ln.Provider,{value:xs},K.createElement(Jr.Provider,{value:ys},K.createElement(es.Provider,{value:vs},c)),K.createElement(Bl,{disabled:i?.restoreFocus===!1})),K.createElement(Zc,{...i,hiddenTextDescribedById:Je}));function ws(){const z=ce?.autoScrollEnabled===!1,Y=typeof l=="object"?l.enabled===!1:l===!1,Q=L&&!z&&!Y;return typeof l=="object"?{...l,enabled:Q}:{enabled:Q}}}),Kl=u.createContext(null),qo="button",Gl="Draggable";function Wl(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const s=Lt(Gl),{activators:a,activatorEvent:i,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:h,over:f}=u.useContext(ln),{role:m=qo,roleDescription:g="draggable",tabIndex:v=0}=r??{},b=l?.id===t,y=u.useContext(b?es:Kl),[w,R]=Yt(),[S,P]=Yt(),L=Il(a,t),E=yt(n);pe(()=>(h.set(t,{id:t,key:s,node:w,activatorNode:S,data:E}),()=>{const C=h.get(t);C&&C.key===s&&h.delete(t)}),[h,t]);const x=u.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":o,"aria-pressed":b&&m===qo?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[o,m,v,b,g,d.draggable]);return{active:l,activatorEvent:i,activeNodeRect:c,attributes:x,isDragging:b,listeners:o?void 0:L,node:w,over:f,setNodeRef:R,setActivatorNodeRef:P,transform:y}}function ql(){return u.useContext(Jr)}const Xl="Droppable",Yl={timeout:25};function Ql(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const s=Lt(Xl),{active:a,dispatch:i,over:l,measureDroppableContainers:c}=u.useContext(ln),d=u.useRef({disabled:n}),h=u.useRef(!1),f=u.useRef(null),m=u.useRef(null),{disabled:g,updateMeasurementsFor:v,timeout:b}={...Yl,...r},y=yt(v??o),w=u.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),m.current=null},b)},[b]),R=cn({callback:w,disabled:g||!a}),S=u.useCallback((x,C)=>{R&&(C&&(R.unobserve(C),h.current=!1),x&&R.observe(x))},[R]),[P,L]=Yt(S),E=yt(t);return u.useEffect(()=>{!R||!P.current||(R.disconnect(),h.current=!1,R.observe(P.current))},[P,R]),u.useEffect(()=>(i({type:j.RegisterDroppable,element:{id:o,key:s,disabled:n,node:P,rect:f,data:E}}),()=>i({type:j.UnregisterDroppable,key:s,id:o})),[o]),u.useEffect(()=>{n!==d.current.disabled&&(i({type:j.SetDroppableDisabled,id:o,key:s,disabled:n}),d.current.disabled=n)},[o,s,n,i]),{active:a,rect:f,isOver:l?.id===o,node:P,over:l,setNodeRef:L}}const Od=e=>{let{transform:t}=e;return{...t,y:0}},Jl=e=>{let{transform:t}=e;return{...t,x:0}};function ts(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function eu(e,t){return e.reduce((n,o,r)=>{const s=t.get(o);return s&&(n[r]=s),n},Array(e.length))}function Vt(e){return e!==null&&e>=0}function tu(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function nu(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ft={scaleX:1,scaleY:1},kd=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:s,index:a}=e;const i=(t=n[r])!=null?t:o;if(!i)return null;const l=ou(n,a,r);if(a===r){const c=n[s];return c?{x:r<s?c.left+c.width-(i.left+i.width):c.left-i.left,y:0,...Ft}:null}return a>r&&a<=s?{x:-i.width-l,y:0,...Ft}:a<r&&a>=s?{x:i.width+l,y:0,...Ft}:{x:0,y:0,...Ft}};function ou(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return!o||!r&&!s?0:n<t?r?o.left-(r.left+r.width):s.left-(o.left+o.width):s?s.left-(o.left+o.width):o.left-(r.left+r.width)}const ns=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const s=ts(t,o,n),a=t[r],i=s[r];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Ht={scaleX:1,scaleY:1},ru=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:s,overIndex:a}=e;const i=(t=s[n])!=null?t:o;if(!i)return null;if(r===n){const c=s[a];return c?{x:0,y:n<a?c.top+c.height-(i.top+i.height):c.top-i.top,...Ht}:null}const l=su(s,r,n);return r>n&&r<=a?{x:0,y:-i.height-l,...Ht}:r<n&&r>=a?{x:0,y:i.height+l,...Ht}:{x:0,y:0,...Ht}};function su(e,t,n){const o=e[t],r=e[t-1],s=e[t+1];return o?n<t?r?o.top-(r.top+r.height):s?s.top-(o.top+o.height):0:s?s.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}const os="Sortable",rs=K.createContext({activeIndex:-1,containerId:os,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ns,disabled:{draggable:!1,droppable:!1}});function au(e){let{children:t,id:n,items:o,strategy:r=ns,disabled:s=!1}=e;const{active:a,dragOverlay:i,droppableRects:l,over:c,measureDroppableContainers:d}=ql(),h=Lt(os,n),f=i.rect!==null,m=u.useMemo(()=>o.map(L=>typeof L=="object"&&"id"in L?L.id:L),[o]),g=a!=null,v=a?m.indexOf(a.id):-1,b=c?m.indexOf(c.id):-1,y=u.useRef(m),w=!tu(m,y.current),R=b!==-1&&v===-1||w,S=nu(s);pe(()=>{w&&g&&d(m)},[w,m,g,d]),u.useEffect(()=>{y.current=m},[m]);const P=u.useMemo(()=>({activeIndex:v,containerId:h,disabled:S,disableTransforms:R,items:m,overIndex:b,useDragOverlay:f,sortedRects:eu(m,l),strategy:r}),[v,h,S.draggable,S.droppable,R,m,b,l,f,r]);return K.createElement(rs.Provider,{value:P},t)}const iu=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return ts(n,o,r).indexOf(t)},cu=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:s,newIndex:a,previousItems:i,previousContainerId:l,transition:c}=e;return!c||!o||i!==s&&r===a?!1:n?!0:a!==r&&t===l},lu={duration:200,easing:"ease"},ss="transform",uu=wt.Transition.toString({property:ss,duration:0,easing:"linear"}),du={roleDescription:"sortable"};function hu(e){let{disabled:t,index:n,node:o,rect:r}=e;const[s,a]=u.useState(null),i=u.useRef(n);return pe(()=>{if(!t&&n!==i.current&&o.current){const l=r.current;if(l){const c=Ye(o.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&a(d)}}n!==i.current&&(i.current=n)},[t,n,o,r]),u.useEffect(()=>{s&&a(null)},[s]),s}function fu(e){let{animateLayoutChanges:t=cu,attributes:n,disabled:o,data:r,getNewIndex:s=iu,id:a,strategy:i,resizeObserverConfig:l,transition:c=lu}=e;const{items:d,containerId:h,activeIndex:f,disabled:m,disableTransforms:g,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:w}=u.useContext(rs),R=pu(o,m),S=d.indexOf(a),P=u.useMemo(()=>({sortable:{containerId:h,index:S,items:d},...r}),[h,r,S,d]),L=u.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:x,isOver:C,setNodeRef:I}=Ql({id:a,data:P,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...l}}),{active:_,activatorEvent:M,activeNodeRect:U,attributes:D,setNodeRef:ce,listeners:G,isDragging:V,over:Mt,setActivatorNodeRef:me,transform:Je}=Wl({id:a,data:P,attributes:{...du,...n},disabled:R.draggable}),At=Mc(I,ce),W=!!_,ge=W&&!g&&Vt(f)&&Vt(b),Te=!y&&V,et=Te&&ge?Je:null,It=ge?et??(i??w)({rects:v,activeNodeRect:U,activeIndex:f,overIndex:b,index:S}):null,Se=Vt(f)&&Vt(b)?s({id:a,items:d,activeIndex:f,overIndex:b}):S,ve=_?.id,T=u.useRef({activeId:ve,items:d,newIndex:Se,containerId:h}),tt=d!==T.current.items,le=t({active:_,containerId:h,isDragging:V,isSorting:W,id:a,index:S,items:d,newIndex:T.current.newIndex,previousItems:T.current.items,previousContainerId:T.current.containerId,transition:c,wasDragging:T.current.activeId!=null}),je=hu({disabled:!le,index:S,node:x,rect:E});return u.useEffect(()=>{W&&T.current.newIndex!==Se&&(T.current.newIndex=Se),h!==T.current.containerId&&(T.current.containerId=h),d!==T.current.items&&(T.current.items=d)},[W,Se,h,d]),u.useEffect(()=>{if(ve===T.current.activeId)return;if(ve!=null&&T.current.activeId==null){T.current.activeId=ve;return}const Oe=setTimeout(()=>{T.current.activeId=ve},50);return()=>clearTimeout(Oe)},[ve]),{active:_,activeIndex:f,attributes:D,data:P,rect:E,index:S,newIndex:Se,items:d,isOver:C,isSorting:W,isDragging:V,listeners:G,node:x,overIndex:b,over:Mt,setNodeRef:At,setActivatorNodeRef:me,setDroppableNodeRef:I,setDraggableNodeRef:ce,transform:je??It,transition:be()};function be(){if(je||tt&&T.current.newIndex===S)return uu;if(!(Te&&!Qn(M)||!c)&&(W||le))return wt.Transition.toString({...c,property:ss})}}function pu(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}function en(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const mu=[A.Down,A.Right,A.Up,A.Left],gu=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:s,over:a,scrollableAncestors:i}}=t;if(mu.includes(e.code)){if(e.preventDefault(),!n||!o)return;const l=[];s.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const f=r.get(h.id);if(f)switch(e.code){case A.Down:o.top<f.top&&l.push(h);break;case A.Up:o.top>f.top&&l.push(h);break;case A.Left:o.left>f.left&&l.push(h);break;case A.Right:o.left<f.left&&l.push(h);break}});const c=Kc({collisionRect:o,droppableRects:r,droppableContainers:l});let d=Zr(c,"id");if(d===a?.id&&c.length>1&&(d=c[1].id),d!=null){const h=s.get(n.id),f=s.get(d),m=f?r.get(f.id):null,g=f?.node.current;if(g&&m&&h&&f){const b=an(g).some((L,E)=>i[E]!==L),y=as(h,f),w=vu(h,f),R=b||!y?{x:0,y:0}:{x:w?o.width-m.width:0,y:w?o.height-m.height:0},S={x:m.left,y:m.top};return R.x&&R.y?S:xt(S,R)}}}};function as(e,t){return!en(e)||!en(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function vu(e,t){return!en(e)||!en(t)||!as(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const bu=e=>{const{data:t}=or({queryKey:bt.notes.pinned(),async queryFn(){const n=await Fn(`
|
|
19
|
+
query FetchPinnedNotes {
|
|
20
|
+
pinnedNotes {
|
|
21
|
+
id
|
|
22
|
+
title
|
|
23
|
+
order
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`);if(n.type==="error")throw n;return n.pinnedNotes}});return p.jsx(p.Fragment,{children:e.render(t)})},yu="focus-ring-soft flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-tertiary opacity-70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default hover:opacity-100 focus-visible:opacity-100 active:cursor-grabbing touch-none",xu="focus-ring-soft block truncate rounded-[10px] px-1.5 py-1 outline-none transition-colors",wu=(e,t,n)=>{if(t===n)return null;const o=e.findIndex(i=>i.id===t),r=e.findIndex(i=>i.id===n);if(o<0||r<0)return null;const s=[...e],[a]=s.splice(o,1);return a?(s.splice(r,0,a),{nextItems:s,orders:s.map((i,l)=>({id:i.id,order:l}))}):null};function Su({id:e,title:t,isActive:n=!1,children:o}){const{attributes:r,listeners:s,setNodeRef:a,setActivatorNodeRef:i,transform:l,transition:c,isDragging:d}=fu({id:e}),h={transform:wt.Transform.toString(l),transition:c,opacity:d?.5:1};return p.jsxs("div",{ref:a,style:h,className:ae("group flex min-h-[38px] items-center gap-1.5 rounded-[12px] px-1.5 py-1 transition-colors",n?"bg-hover-subtle":"hover:bg-hover-subtle/70"),children:[p.jsx("button",{type:"button",ref:i,"aria-label":`Reorder note ${t??"Untitled"}`,title:"Drag to reorder",...r,...s,className:ae(yu,d?"cursor-grabbing":"cursor-grab"),children:p.jsx(Yi,{className:"size-4"})}),p.jsx(te,{as:"div",truncate:!0,variant:"meta",weight:"medium",className:"min-w-0 flex-1",children:o})]})}function Ru({notes:e,pathname:t,pinnedItems:n,setPinnedItems:o,handleDragEnd:r,sensors:s}){u.useEffect(()=>{o(e)},[e,o]);const a=n.length>0?n:e;return a.length===0?null:p.jsx(Ul,{sensors:s,collisionDetection:Uc,onDragEnd:r,modifiers:[Jl],children:p.jsx(au,{items:a.map(i=>i.id),strategy:ru,children:a.map(i=>p.jsx(Su,{id:i.id,title:i.title||"Untitled",isActive:t===`/${i.id}`,children:p.jsx(zt,{"aria-current":t===`/${i.id}`?"page":void 0,className:ae(xu,t===`/${i.id}`?"text-fg-default":"text-fg-secondary hover:text-fg-default"),to:Hn,params:{id:i.id},children:i.title||"Untitled"})},i.id))})})}const Eu=()=>{const e=rn({select:i=>i.pathname}),t=Vn(),[n,o]=u.useState([]),r=As({mutationFn:pa,onSuccess:()=>{t.invalidateQueries({queryKey:bt.notes.pinned(),exact:!0})}}),s=$c(ko(no,{activationConstraint:{distance:8}}),ko(eo,{coordinateGetter:gu})),a=i=>{const{active:l,over:c}=i;c&&l.id!==c.id&&o(d=>{const h=wu(d,String(l.id),String(c.id));return h?(r.mutate(h.orders),h.nextItems):d})};return p.jsx("div",{className:"border-l border-border-subtle/70 pl-1.5",children:p.jsx(rr,{fallback:p.jsxs("div",{className:"space-y-1",children:[p.jsx(ut,{height:"40px",opacity:.4}),p.jsx(ut,{height:"40px",opacity:.4})]}),errorTitle:"Failed to load pinned notes",errorDescription:"Retry loading the pinned note list.",renderError:({error:i,retry:l})=>p.jsx(fa,{title:"Failed to load pinned notes",description:"Retry loading the pinned note list.",error:i,onRetry:l,showBackAction:!1,showHomeAction:!1}),children:p.jsx(bu,{render:i=>i.length>0?p.jsx(Ru,{notes:i,pathname:e,pinnedItems:n,setPinnedItems:o,handleDragEnd:a,sensors:s}):p.jsx(te,{as:"div",variant:"meta",tone:"secondary",className:"px-2 py-2.5 leading-6",children:"Pin a note from the note toolbar to keep it here."})})})})},Cu=()=>p.jsx("section",{className:"p-3 pt-0","aria-label":"Pinned notes",children:p.jsx(Eu,{})}),Pu="p-3 pb-0",_u="focus-ring-soft surface-base group flex w-full items-center justify-between gap-2.5 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",Lu="flex items-center gap-2.5",Mu="inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-cta text-fg-on-filled",Au="flex flex-col",Iu="h-4 w-4 text-fg-tertiary transition-colors group-hover:text-fg-default",Tu=()=>{const{onCreate:e}=Jo();return p.jsx("div",{className:Pu,children:p.jsxs("button",{type:"button",className:_u,onClick:()=>e(),children:[p.jsxs("span",{className:Lu,children:[p.jsx("span",{className:Mu,children:p.jsx(Qi,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:Au,children:[p.jsx(te,{variant:"meta",weight:"semibold",tracking:"tight",children:"Capture"}),p.jsx(te,{variant:"label",tone:"secondary",children:"Open a new note"})]})]}),p.jsx(ma,{className:Iu,weight:"bold"})]})})},Du=/Mac|iPhone|iPad|iPod/i,Nu=()=>typeof navigator>"u"?"":`${navigator.platform} ${navigator.userAgent}`,is=(e=Nu())=>Du.test(e)?"⌘K":"Ctrl+K",ju="focus-ring-soft surface-base group flex min-h-14 w-full items-center justify-between gap-3 px-3 py-2.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",Ou=()=>{const e=On(),t=is(),n=()=>{e({to:Ct,search:{query:"",page:1,mode:"hybrid"}})};return p.jsxs("button",{type:"button",className:ju,"aria-label":"Open detailed search","aria-keyshortcuts":"Meta+K Control+K",onClick:n,children:[p.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[p.jsx("span",{className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[13px] bg-muted text-fg-secondary transition-colors group-hover:text-fg-default",children:p.jsx(hr,{className:"h-4.5 w-4.5",weight:"bold"})}),p.jsxs("span",{className:"flex min-w-0 flex-col",children:[p.jsx(te,{as:"span",variant:"meta",weight:"semibold",tracking:"tight",children:"Search"}),p.jsx(te,{as:"span",variant:"label",tone:"secondary",children:"Find a memory"})]})]}),p.jsx("span",{className:"shrink-0 rounded-[8px] bg-muted px-1.5 py-1 text-label font-medium text-fg-tertiary",children:t})]})},ku=()=>p.jsx("div",{className:"p-3",children:p.jsx(Ou,{})}),Vu=[{name:"Search",path:Ct,icon:hr},{name:"Notes",path:tn,icon:Ir},{name:"Views",path:sr,icon:Is},{name:"Graph",path:ar,icon:Na},{name:"Calendar",path:ir,icon:Xi},{name:"Reminders",path:cr,icon:Ts},{name:"Tags",path:lr,icon:Ds},{name:"Setting",path:ur,icon:Ns}],Fu=()=>{const e=rn({select:n=>n.pathname}),t=is();return p.jsx("nav",{"aria-label":"Primary navigation",className:"flex items-center gap-1 px-4 py-2.5",children:Vu.map((n,o)=>{const r=e===n.path||n.path!==tn&&e.startsWith(`${n.path}/`),s=n.path===Ct?t:void 0;return p.jsxs(u.Fragment,{children:[o>0&&p.jsx("span",{className:"h-3.5 w-px shrink-0 bg-border-subtle"}),p.jsx(zt,{to:n.path,"aria-keyshortcuts":s?"Meta+K Control+K":void 0,title:s?`${n.name} (${s})`:void 0,children:p.jsxs("div",{className:`flex min-w-26 items-center justify-center gap-2 border-b px-2 py-2 transition-colors ${r?"border-fg-muted text-fg-default":"border-transparent text-fg-secondary hover:border-border-subtle hover:text-fg-default"}`,children:[p.jsx(n.icon,{className:"size-5",weight:r?"fill":"regular"}),p.jsx(te,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:n.name})]})})]},n.path)})})},Hu=({children:e})=>p.jsx(Cc,{sidebar:p.jsxs(p.Fragment,{children:[p.jsx(Lc,{}),p.jsx(Tu,{}),p.jsx(ku,{}),p.jsx(Cu,{}),p.jsx(fc,{})]}),topNavigation:p.jsx(Fu,{}),children:e}),cs=100,ls=[50,cs,200];function Vd(e){return ls.includes(e)}const Bu=["updatedAt","createdAt"],Zu=["referenceCount","name"],us=["asc","desc"],$u=["create","update"],zu=["hybrid","lexical","semantic"],un=e=>Array.isArray(e)?e[0]:e,Ie=(e,t,{min:n=1,max:o=Number.MAX_SAFE_INTEGER}={})=>{const r=un(e),s=typeof r=="number"?r:typeof r=="string"?Number(r):Number.NaN;return!Number.isInteger(s)||s<n||s>o?t:s},ds=(e,t,n)=>{const o=Ie(e,Number.NaN);return t.includes(o)?o:n},Uu=(e,t=!1)=>{const n=un(e);return n===!0||n==="true"?!0:n===!1||n==="false"?!1:t},dn=(e,t="")=>{const n=un(e);return typeof n=="string"?n:t},We=(e,t,n)=>{const o=un(e);return typeof o!="string"?n:t.includes(o)?o:n},Ku=e=>({page:Ie(e.page,1),limit:ds(e.limit,tr,nr),sortBy:We(e.sortBy,Bu,"updatedAt"),sortOrder:We(e.sortOrder,us,"desc"),pinnedFirst:Uu(e.pinnedFirst,!1)}),Qe=e=>({page:Ie(e.page,1)}),Gu=e=>({page:Ie(e.page,1),query:dn(e.query,""),mode:We(e.mode,zu,"hybrid")}),Wu=e=>({page:Ie(e.page,1),query:dn(e.query,""),limit:ds(e.limit,ls,cs),sortBy:We(e.sortBy,Zu,"referenceCount"),sortOrder:We(e.sortOrder,us,"desc")}),qu=e=>({year:Ie(e.year,ho().year(),{min:1970,max:9999}),month:Ie(e.month,ho().month()+1,{min:1,max:12}),type:We(e.type,$u,"create")}),Xu=e=>{const t=dn(e.selected,"").trim();return t?{selected:t}:{}},Yu=e=>({page:Ie(e.page,1),sectionId:dn(e.sectionId,"")}),Qu=e=>{const{data:t}=or({queryKey:bt.notes.list(e.searchParams),async queryFn(){const n=await ga(e.searchParams);if(n.type==="error")throw n;return n.allNotes}});return e.render(t)};function Ju({id:e,title:t,tags:n,pinned:o,updatedAt:r,onPinned:s,onDelete:a}){const i=js(Number(r));return p.jsxs("div",{className:ae("surface-base group relative flex h-full flex-col px-4 py-3.5 transition-colors"),children:[o&&p.jsx("div",{className:"absolute left-1/2 top-0 z-[1] -translate-x-1/2 -translate-y-[38%]",children:p.jsxs("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-border-secondary/70 bg-elevated text-fg-tertiary shadow-[0_8px_18px_-14px_rgba(23,29,38,0.32)]",children:[p.jsx(Os,{className:"h-3.5 w-3.5",weight:"fill"}),p.jsx("span",{className:"sr-only",children:"Pinned note"})]})}),p.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[p.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1",children:p.jsxs(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Updated ",i]})}),p.jsx(va,{button:p.jsx(ks,{label:"Note actions",size:"sm"}),items:[{name:o?"Unpin":"Pin",onClick:()=>s?.()},{name:"Delete",onClick:()=>a?.()}]})]}),p.jsxs("div",{className:"flex flex-1 flex-col justify-between gap-2.5",children:[p.jsx(te,{as:"div",variant:"body",weight:"semibold",tracking:"tight",className:"leading-[1.45]",children:p.jsx(zt,{className:"line-clamp-2 transition-colors hover:text-fg-default/85",to:Hn,params:{id:e},children:t||"Untitled"})}),n.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1.5 pt-0.5",children:n.map(l=>p.jsx(zt,{to:dr,params:{id:l.id},search:{page:1},children:p.jsx(te,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center rounded-full border border-border-subtle bg-transparent px-2 py-0.5 transition-colors hover:bg-hover-subtle hover:text-fg-default",children:l.name})},l.id))})]})]})]},e)}const Xo=ba(tn);function ed(){const e=Xo.useNavigate(),{limit:t,page:n,sortBy:o,sortOrder:r,pinnedFirst:s}=Xo.useSearch(),{onDelete:a,onPinned:i,deleteWarningDialog:l}=Jo(),c=d=>{e({search:h=>({...h,...d})})};return p.jsxs(ya,{title:"",variant:"none",children:[p.jsxs("div",{className:"flex flex-col gap-5",children:[p.jsx(uc,{itemsPerPage:t,onItemsPerPageChange:d=>c({limit:d,page:1}),sortBy:o,onSortByChange:d=>c({sortBy:d,page:1}),sortOrder:r,onSortOrderChange:d=>c({sortOrder:d,page:1}),pinnedFirst:s,onPinnedFirstChange:d=>c({pinnedFirst:d,page:1})}),p.jsx(rr,{fallback:p.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"}),p.jsx(ut,{height:"112px"})]}),errorTitle:"Failed to load notes",errorDescription:"Retry loading the current note list.",resetKeys:[n,t,o,r,s],children:p.jsx(Qu,{searchParams:{offset:(n-1)*t,limit:t,sortBy:o,sortOrder:r,pinnedFirst:s},render:({notes:d,totalCount:h})=>p.jsx(jo,{fallback:p.jsx(wa,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"grid-auto-cards grid gap-5",children:d.map(f=>p.jsx(Ju,{...f,onPinned:()=>i(f.id,f.pinned),onDelete:()=>a(f.id)},f.id))}),p.jsx(jo,{fallback:null,children:h&&t<h&&p.jsx(xa,{page:n,last:Math.ceil(h/t),onChange:f=>{c({page:f})}})})]})})})})]}),l]})}const k=Sa({component:()=>p.jsx(Hu,{children:p.jsx(_r,{})}),errorComponent:Ea,notFoundComponent:Ra}),td=O({getParentRoute:()=>k,path:tn,component:ed,validateSearch:Ku}),nd=O({getParentRoute:()=>k,path:ir,component:$(()=>Z(()=>import("./Calendar-D7QJsAlg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading calendar",description:"Preparing note and reminder snapshots."}),validateSearch:qu}),od=O({getParentRoute:()=>k,path:sr,component:$(()=>Z(()=>import("./Views-CWE99SnI.js"),__vite__mapDeps([8,1,4,2,3,9,10,11,12,13,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading views",description:"Preparing your saved dashboards."})}),rd=O({getParentRoute:()=>k,path:cr,component:$(()=>Z(()=>import("./Reminders-COr1OHvF.js"),__vite__mapDeps([15,1,2,3,16,4]))),pendingComponent:()=>p.jsx(H,{title:"Loading reminders",description:"Collecting upcoming reminder cards."}),validateSearch:Qe}),sd=O({getParentRoute:()=>k,path:ar,component:$(()=>Z(()=>import("./Graph-DYUb7gQb.js"),__vite__mapDeps([17,1,2,3,18,19,20,21,22,23,24,7,13]))),pendingComponent:()=>p.jsx(H,{title:"Loading graph",description:"Preparing the linked note constellation."}),validateSearch:Xu}),ad=O({getParentRoute:()=>k,path:Ct,component:$(()=>Z(()=>import("./Search-Ctkx0BQk.js"),__vite__mapDeps([25,1,4,2,3,26,7,11,27,28,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading search",description:"Preparing indexed note results."}),validateSearch:Gu}),id=O({getParentRoute:()=>k,path:lr,component:$(()=>Z(()=>import("./Tag-BjxtrIQW.js"),__vite__mapDeps([29,1,2,3,9,7,4,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading tags",description:"Preparing the tag catalog."}),validateSearch:Wu}),cd=O({getParentRoute:()=>k,path:Hn,component:$(()=>Z(()=>import("./Note-DsMhwrHw.js"),__vite__mapDeps([30,1,2,3,4,5,31,26,14,12,16,32,33,34,6,35,36,37,38,9,28]))),pendingComponent:()=>p.jsx(H,{title:"Loading note",description:"Preparing the editor and note content."})}),ld=O({getParentRoute:()=>k,path:dr,component:$(()=>Z(()=>import("./TagNotes-DV_fdRbg.js"),__vite__mapDeps([39,1,2,3,31,4,26,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading tagged notes",description:"Preparing notes for the selected tag."}),validateSearch:Qe}),ud=O({getParentRoute:()=>k,path:Pa,component:$(()=>Z(()=>import("./ViewNotes-wWWeFJyU.js"),__vite__mapDeps([40,1,4,2,3,9,10,11,31,26,14,38,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading view notes",description:"Preparing notes for this saved view section."}),validateSearch:Yu}),dd=O({getParentRoute:()=>k,path:ur,component:$(()=>Z(()=>import("./index-B-E1Ilh9.js"),__vite__mapDeps([41,1,4,2,3,42,43,44,7,6]))),pendingComponent:()=>p.jsx(H,{title:"Loading settings",description:"Preparing workspace preferences."})}),hd=O({getParentRoute:()=>k,path:La,component:$(()=>Z(()=>import("./mcp-CCaFd0zm.js"),__vite__mapDeps([45,1,4,2,3,42,37]))),pendingComponent:()=>p.jsx(H,{title:"Loading MCP settings",description:"Preparing MCP access controls."})}),fd=O({getParentRoute:()=>k,path:_a,component:$(()=>Z(()=>import("./search-D-xKTPdO.js"),__vite__mapDeps([46,1,4,2,3,27,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading search settings",description:"Preparing semantic search controls."})}),pd=O({getParentRoute:()=>k,path:Ma,component:$(()=>Z(()=>import("./trash-D4-9sv8q.js"),__vite__mapDeps([47,1,4,2,3,12,31,26,14]))),pendingComponent:()=>p.jsx(H,{title:"Loading trash",description:"Preparing deleted notes for restore."}),validateSearch:Qe}),md=O({getParentRoute:()=>k,path:Aa,component:$(()=>Z(()=>import("./manage-image-azmo5iVw.js"),__vite__mapDeps([48,1,2,3,4,36,49,12,44]))),pendingComponent:()=>p.jsx(H,{title:"Loading image manager",description:"Preparing uploaded image metadata."}),validateSearch:Qe}),gd=O({getParentRoute:()=>k,path:Ia,component:$(()=>Z(()=>import("./manage-image-detail-BF-uSqb_.js"),__vite__mapDeps([50,1,2,3,4,36,49,12,31,26,14,44,43,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading image detail",description:"Preparing references for the selected image."})}),vd=O({getParentRoute:()=>k,path:Da,component:$(()=>Z(()=>import("./properties-BrNJLkxR.js"),__vite__mapDeps([51,1,4,2,3]))),pendingComponent:()=>p.jsx(H,{title:"Loading properties",description:"Preparing shared property definitions."}),validateSearch:Qe}),bd=O({getParentRoute:()=>k,path:Ta,component:$(()=>Z(()=>import("./placeholder-AusSo8p9.js"),__vite__mapDeps([52,1,4,2,3,12,14,6,7]))),pendingComponent:()=>p.jsx(H,{title:"Loading placeholders",description:"Preparing template replacement rules."}),validateSearch:Qe}),yd=k.addChildren([td,od,nd,rd,sd,ad,id,cd,ld,ud,dd,fd,hd,pd,md,gd,bd,vd]),xd=Bi({routeTree:yd,defaultPreload:"intent",defaultPendingComponent:()=>p.jsx(H,{title:"Loading page",description:"Preparing the next route."})});function wd(){const e=Cn(n=>n.setSystemTheme),t=Cn(n=>n.setTheme);return u.useEffect(()=>{const n=bo();return n&&t(n),ka.listenThemeChange(o=>{bo()||e(o?"dark":"light")},n==null)},[e,t]),p.jsx(lc,{children:p.jsx(zi,{router:xd})})}const hs="__oceanBrainCsrfRetry";let En;const Sd=e=>!Ge.isAxiosError(e)||e.response?.status!==403?!1:e.response.data?.code==="CSRF_TOKEN_INVALID",fs=e=>{if(!Sd(e)||!Ge.isAxiosError(e))return!1;const t=e.config;return!!(t&&!t[hs])},Rd=()=>(En??=Xt().finally(()=>{En=void 0}),En),Yo=(e,t)=>{if(!e)return;const n=e;if(typeof n.delete=="function"){n.delete(t);return}delete e[t]},Ed=e=>{Yo(e.headers,"X-XSRF-TOKEN"),Yo(e.headers,"x-xsrf-token")},Cd=async e=>{if(!fs(e)||!Ge.isAxiosError(e))return Promise.reject(e);const t=e.config;return t[hs]=!0,await Rd()!=="active"?Promise.reject(e):(Ed(t),Ge.request(t))};let Qo;const Pd=()=>{Qo===void 0&&(Qo=Ge.interceptors.response.use(e=>e,e=>{if(nc(e))Nr();else if(fs(e))return Cd(e);return Promise.reject(e)}))};Cn.setState({theme:Ca()});Pd();Xt();Vs.createRoot(document.getElementById("root")).render(p.jsx(K.StrictMode,{children:p.jsx(wd,{})}));export{wt as C,Ul as D,jo as F,eo as K,gl as M,Ju as N,no as P,au as S,ls as T,cs as a,Ji as b,_c as c,ko as d,gu as e,Uc as f,fu as g,kd as h,Vd as i,Jl as j,Qi as k,Xi as l,Yi as m,Od as r,Ir as s,$c as u,ru as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as ln,G as un,H as M,I,J as H,K as an,L as y,M as tn,N as j,O as _,P as rn,Q as o,R as on,S as sn,T as fn}from"./mermaid.core-B14ZAmWA.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,J,u){var D=q-l,i=O-h,n=J-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,J){var u=l-q,D=h-O,i=(J?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,K=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),F=(P*g-m*E)/A,G=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=F-K,e=G-t,r=w-K,L=p-t;return x*x+e*e>r*r+L*L&&(F=w,G=p),{cx:F,cy:G,x01:-n,y01:-d,x11:F*(v/T-1),y11:G*(v/T-1)}}function hn(){var l=cn,h=yn,q=H(0),O=null,v=gn,R=dn,J=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,K=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(K>tn-y)u.moveTo(s*M(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*M(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=K,E=K,F=J.apply(this,arguments)/2,G=F>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(G>y){var L=sn(G/a*I(F)),z=sn(G/s*I(F));(P-=L*2)>y?(L*=t?1:-1,A+=L,T-=L):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var N=s*M(m),Q=s*I(m),B=a*M(T),C=a*I(T);if(w>y){var U=s*M(g),V=s*I(g),X=a*M(A),Y=a*I(A),S;if(K<un)if(S=pn(N,Q,X,Y,U,V,B,C)){var Z=N-S[0],$=Q-S[1],k=U-S[0],b=V-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,N,Q,s,x,t),r=W(U,V,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(N,Q),u.arc(0,0,s,m,g,!t)):u.moveTo(N,Q),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,U,V,a,-p,t),r=W(N,Q,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[M(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:H(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:H(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:H(+n),i):R},i.padAngle=function(n){return arguments.length?(J=typeof n=="function"?n:H(+n),i):J},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
|