@forsion/unit 2.13.4 → 2.13.6
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 -2
- package/main.mjs +129 -10
- package/package.json +1 -1
- package/release.json +6 -5
- package/web/assets/ArtificialView-DHqb9CTL.js +1 -0
- package/web/assets/AutomationBuilder-CzBKmOiw.js +1 -0
- package/web/assets/CalendarConfigView-Blw47NCs.js +1 -0
- package/web/assets/CalendarSide-CFSzme3H.js +1 -0
- package/web/assets/CalendarView-B8sQfgZt.js +3 -0
- package/web/assets/CalendarView-t91KpUG7.css +1 -0
- package/web/assets/CapabilityMenu-Dzn6RbB1.js +1 -0
- package/web/assets/Chrome-owLewFu4.js +1 -0
- package/web/assets/{CodeView-GZ0BAgoW.js → CodeView-E18NDilX.js} +3 -3
- package/web/assets/CtxMenuButtons-CAiwQkOK.js +1 -0
- package/web/assets/DashboardGridView-CBbYKcCo.js +25 -0
- package/web/assets/DashboardGridView-RoVFSkNO.css +1 -0
- package/web/assets/EventCard-D9uQe7g4.js +1 -0
- package/web/assets/ExcalidrawCanvas-BSOERegJ.js +1 -0
- package/web/assets/ExcalidrawCanvas-BgcFPMpU.css +1 -0
- package/web/assets/FloatingToc-iK08Qpjc.js +1 -0
- package/web/assets/{GitCloneDialog-Bj9G3o-n.css → GitCloneDialog-DOxZk2K0.css} +1 -1
- package/web/assets/GitCloneDialog-DfY0kqhP.js +1 -0
- package/web/assets/HomepageView-BCqFe1Ym.js +4 -0
- package/web/assets/HomepageView-Bx8FbWlY.css +1 -0
- package/web/assets/ImageStudioPanels-DdwihAkT.js +3 -0
- package/web/assets/ImageStudioView-gJSYrmu1.js +1 -0
- package/web/assets/InlineAiPanel-CjYOW0_0.js +1 -0
- package/web/assets/InlineFiles-3g2jMUeA.js +1 -0
- package/web/assets/{MarkdownBlock-DQTuoen3.css → MarkdownBlock-Cqfk5DhC.css} +1 -1
- package/web/assets/MarkdownBlock-DjsGkPZ_.js +58 -0
- package/web/assets/{ModelPill-CzdNh7Mt.css → ModelPill-BiUsuhy3.css} +1 -1
- package/web/assets/ModelPill-DgyXBsL9.js +2 -0
- package/web/assets/MuseLibraryView-D_HBijmU.js +2 -0
- package/web/assets/MuseView-BVDlmM6i.js +7 -0
- package/web/assets/{PageHistoryPanel-Bn4-XmdK.js → PageHistoryPanel-B1EAPZeX.js} +2 -2
- package/web/assets/{PdfAnnotator-Cq8cklTz.js → PdfAnnotator-bdB9evsY.js} +3 -3
- package/web/assets/PenRow-DCOIGlfY.js +1 -0
- package/web/assets/PluginToolCard-BXE5vA1h.js +2 -0
- package/web/assets/PluginToolCard-BmTRr5JT.css +1 -0
- package/web/assets/ProductView-l5Q7uBy6.js +1 -0
- package/web/assets/SettingsPage-fjxfS_Mt.js +3 -0
- package/web/assets/StudioGuestSurface-360CWUwf.js +1 -0
- package/web/assets/TodoListView-BsPt2GUU.js +1 -0
- package/web/assets/Tooltip-CuXpWtdJ.js +1 -0
- package/web/assets/UnifiedPage-6xbFLtXT.js +712 -0
- package/web/assets/UnifiedPage-CTmQpf2T.css +1 -0
- package/web/assets/{ViewSelectionBar-35x8TiLA.js → ViewSelectionBar-C5FDh7fO.js} +2 -2
- package/web/assets/appStore-BskcSDl6.js +455 -0
- package/web/assets/appStore-iy8_Tmac.css +1 -0
- package/web/assets/arrow-up-right-DEykpgsH.js +1 -0
- package/web/assets/{artificial-BzLFkChP.css → artificial-BubVxExB.css} +1 -1
- package/web/assets/astryxBridge-B2IZdPvo.js +69 -0
- package/web/assets/astryxBridge-djzCiy4v.css +1 -0
- package/web/assets/automationListSource-Cm09JKkK.js +1 -0
- package/web/assets/boardSurface-Dv-aVaUJ.js +1 -0
- package/web/assets/calendarNavStore-FKStA7Hh.js +1 -0
- package/web/assets/canvasPrefs-CMulOS0k.js +1 -0
- package/web/assets/chatBoxSurface-BR_G6cxG.js +1 -0
- package/web/assets/chevron-up-C_EDOZzI.js +1 -0
- package/web/assets/{client-CaivGZFR.js → client-DD5czSuF.js} +5 -5
- package/web/assets/code-xml-vTB4LtTf.js +1 -0
- package/web/assets/{codeStudioStore-DhyMazGT.js → codeStudioStore-OswE1_s0.js} +8 -8
- package/web/assets/codingNavigation-BrkLENBZ.css +1 -0
- package/web/assets/contextMenuSurface-DqdYEGuH.js +1 -0
- package/web/assets/copy-plus-CVHqDNny.js +1 -0
- package/web/assets/create-DZWy4zBR.js +14 -0
- package/web/assets/dashboardSurface-Co4byEQm.js +1 -0
- package/web/assets/dbStore-Bc2lC8ZI.js +2 -0
- package/web/assets/deskCapture-BfTzH2aO.js +1 -0
- package/web/assets/{diff2html-Daje9Kkm.js → diff2html-0MkNy2ws.js} +2 -2
- package/web/assets/{docx-preview-CABR7n30.js → docx-preview-CwNWZegI.js} +1 -1
- package/web/assets/draft-DTzuTatQ.js +2 -0
- package/web/assets/drawingStore-BD5m2eqn.js +7 -0
- package/web/assets/file-down-Cjo_T6By.js +1 -0
- package/web/assets/floatingTocSurface-D3IIVNnq.js +1 -0
- package/web/assets/foldActions-utwZpRrA.js +1 -0
- package/web/assets/folder-DiaFWdCg.js +1 -0
- package/web/assets/folder-minus-DUEOcs12.js +1 -0
- package/web/assets/folder-plus-Cmhq0GcR.js +1 -0
- package/web/assets/gestures-Bx9M0le5.js +1 -0
- package/web/assets/git-branch-DzGWffyD.js +1 -0
- package/web/assets/homeCardStatus-NAk4A77P.js +1 -0
- package/web/assets/i18n-CAf4PT1o.css +1 -0
- package/web/assets/i18n.generated-D4-Wu9Wh.js +15 -0
- package/web/assets/imageStudio-CwG21Bat.css +1 -0
- package/web/assets/imageStudio-D67oElIb.js +4 -0
- package/web/assets/index-3VWZ1rsL.js +13 -0
- package/web/assets/index-58wBjkHy.js +3 -0
- package/web/assets/index-B9_zH7f5.js +1 -0
- package/web/assets/index-BQrMYjou.js +1 -0
- package/web/assets/index-BWrWMYua.js +1 -0
- package/web/assets/index-BdLJBf4-.js +1 -0
- package/web/assets/index-Bf3W92Hb.js +1 -0
- package/web/assets/index-BjmPaLFA.js +1 -0
- package/web/assets/index-Bv-vJTzF.js +7 -0
- package/web/assets/index-C7yb62gg.js +1 -0
- package/web/assets/index-C9gBBMYv.js +1 -0
- package/web/assets/index-CiQ59Kib.js +1 -0
- package/web/assets/{index-gt5JBIFf.js → index-CzTUjEMt.js} +2 -2
- package/web/assets/index-D4Qx6o3E.js +1 -0
- package/web/assets/index-DDBcn3UD.js +1 -0
- package/web/assets/index-DEADY94l.js +1 -0
- package/web/assets/index-DGTKsPAQ.js +1 -0
- package/web/assets/index-DRwDqvjf.js +1 -0
- package/web/assets/{index-BGfvNj7R.js → index-DexVkoxH.js} +2 -2
- package/web/assets/{index-O05r2Ty6.js → index-IMOhRWY8.js} +1 -1
- package/web/assets/index-XjvpYHIo.js +1 -0
- package/web/assets/index-YuejkHoJ.js +3412 -0
- package/web/assets/index-pH0266gX.js +1 -0
- package/web/assets/index-sQl_bGM_.js +1 -0
- package/web/assets/index-vbNFy5lS.js +1 -0
- package/web/assets/{invitePage-Bgveo6Hj.js → invitePage-BT_rFfab.js} +1 -1
- package/web/assets/{ipc-B6hkgxQL.js → ipc-8cxXGSZK.js} +1 -1
- package/web/assets/{jszip.min-eU-k-vEy.js → jszip.min-By4OI3XR.js} +1 -1
- package/web/assets/launchpad-BX4jQyF4.js +2 -0
- package/web/assets/launchpad-C9U9hpWJ.css +1 -0
- package/web/assets/layout-grid-CzxXbCDa.js +1 -0
- package/web/assets/linkFollow-J2c0wSgB.js +8 -0
- package/web/assets/{listFold-M8s5JYEC.js → listFold-B_2Xqxn_.js} +1 -1
- package/web/assets/lock-open-DVWCLSZm.js +1 -0
- package/web/assets/log-out-CdKTS7HC.js +1 -0
- package/web/assets/magnet-BmVcZ9U4.js +1 -0
- package/web/assets/main-BlVApHpj.css +1 -0
- package/web/assets/main-CForzSFD.js +15 -0
- package/web/assets/markdownEditorSurface-BiDH0__r.css +1 -0
- package/web/assets/markdownEditorSurface-Bs8FJNHu.js +3 -0
- package/web/assets/mediaPlayer-O9pVRl_k.js +1 -0
- package/web/assets/message-square-plus-CspBv9iG.js +1 -0
- package/web/assets/{messages-CKtabOqy.js → messages-CG7ywZ-K.js} +1 -1
- package/web/assets/minimize-2-Bq4vUin-.js +1 -0
- package/web/assets/mobileEntry-6u7TYC4s.css +1 -0
- package/web/assets/mobileEntry-CptXQ4Ov.js +13 -0
- package/web/assets/modelPickerSurface-C0SkjaPL.js +1 -0
- package/web/assets/nativeDownload-DlnT8U-y.js +1 -0
- package/web/assets/nativeSheetMenu-CVC51DzC.js +1 -0
- package/web/assets/pageStore-BC6Z18n7.css +1 -0
- package/web/assets/pageStore-D_fKLv-o.js +13 -0
- package/web/assets/{pageTree-BYYPgZm_.js → pageTree-DtDKozTg.js} +3 -3
- package/web/assets/pen-line-ho1GgAe2.js +1 -0
- package/web/assets/pen-tool-CV-FKFEZ.js +1 -0
- package/web/assets/pencil-BgF4Kiqp.js +1 -0
- package/web/assets/phoneList-BLVdQcXY.js +1 -0
- package/web/assets/phoneList-BpLxxdq6.css +1 -0
- package/web/assets/pluginChat-C6t6DWhY.js +2 -0
- package/web/assets/react-DOzedx9n.js +1 -0
- package/web/assets/recordSurface-C9SRNjy4.js +1 -0
- package/web/assets/redo-2-DWZTaEz-.js +1 -0
- package/web/assets/rotate-ccw-CyZpL7MX.js +1 -0
- package/web/assets/selectionActions-C2a8ImJm.js +2 -0
- package/web/assets/selectionBarSurface-DaXlyy1s.js +1 -0
- package/web/assets/sessionTitle-BtZ1BteL.js +1 -0
- package/web/assets/settingsPageSurface-Cg8FNZq3.js +1 -0
- package/web/assets/sharePage-vnghra3Q.js +2 -0
- package/web/assets/{shareViewer-BiMqIBxP.js → shareViewer-CWJQHiV-.js} +2 -2
- package/web/assets/star-ZEpUQwnX.js +1 -0
- package/web/assets/tableSurface-DfEdzVDn.js +1 -0
- package/web/assets/tanguProbe-BboOas-a.js +6 -0
- package/web/assets/{terminalView-lbcBgG0c.js → terminalView-xp8ARBLi.js} +3 -3
- package/web/assets/type-CMyP4cKt.js +1 -0
- package/web/assets/undo-2-C4ZCsMsx.js +1 -0
- package/web/assets/{unitAccount-DGwGsmC3.js → unitAccount-DNxfGo3c.js} +1 -1
- package/web/assets/{unitBridge-CE2yAvm0.js → unitBridge-Bq0n1ZM6.js} +1 -1
- package/web/assets/{unitCloudTransport-BGFwkaDM.js → unitCloudTransport-CErylgEO.js} +1 -1
- package/web/assets/unitOwnerAccess-7s-3dfNM.js +1 -0
- package/web/assets/unitShim-BfheyIG8.js +5 -0
- package/web/assets/upload-VtCrluEO.js +1 -0
- package/web/assets/userSpaces-BpeYjLni.js +1 -0
- package/web/assets/viewportLock-B0l1GU_k.css +1 -0
- package/web/assets/viewportLock-cVUalJAI.js +738 -0
- package/web/assets/zoom-in-C7R8s9x-.js +1 -0
- package/web/excalidraw/excalidraw.js +4 -2
- package/web/index.html +12 -13
- package/web/assets/ArtificialView-DLh75dAI.js +0 -1
- package/web/assets/AutomationBuilder-DNWWGnFr.js +0 -1
- package/web/assets/CalendarConfigView-G7je7k9-.js +0 -1
- package/web/assets/CalendarView-B2MtaOJk.js +0 -1
- package/web/assets/CapabilityMenu-DJaZ_Cyt.js +0 -1
- package/web/assets/CheckboxInput-FYXLaZke.js +0 -1
- package/web/assets/Chrome-CFonajM4.js +0 -1
- package/web/assets/DashboardGridView-D9s9pez_.css +0 -1
- package/web/assets/DashboardGridView-Xgw4wa0_.js +0 -17
- package/web/assets/EventCard-_39F_I5M.js +0 -1
- package/web/assets/ExcalidrawCanvas-4uYrLYin.css +0 -1
- package/web/assets/ExcalidrawCanvas-rXujil36.js +0 -1
- package/web/assets/FloatingToc-DNqAkkI0.js +0 -1
- package/web/assets/GitCloneDialog-CQx-O4j1.js +0 -1
- package/web/assets/HomepageView-DcWmTPQO.css +0 -1
- package/web/assets/HomepageView-MYEk3RCs.js +0 -3
- package/web/assets/ImageStudioPanels-4wnb2XF4.js +0 -3
- package/web/assets/ImageStudioView-qrmW8pfx.js +0 -1
- package/web/assets/InlineAiPanel-B3kd1ob2.js +0 -1
- package/web/assets/InlineFiles-Clnqh9jD.js +0 -1
- package/web/assets/MarkdownBlock-DT_wsaja.js +0 -58
- package/web/assets/ModelPill-JaIH3ffZ.js +0 -2
- package/web/assets/MuseLibraryView-DOJVVeU6.js +0 -2
- package/web/assets/MuseView-uxTmjVQa.js +0 -6
- package/web/assets/PenRow-COOYAaxx.js +0 -1
- package/web/assets/ProductView-DPTveulg.js +0 -1
- package/web/assets/RightPanel-BJUacrsf.js +0 -4
- package/web/assets/RightPanel-D0zk1g3I.css +0 -1
- package/web/assets/SketchCard-B_UU5sxV.js +0 -641
- package/web/assets/StudioGuestSurface-yBa4QKfX.js +0 -1
- package/web/assets/TargetHealthNotice-BLzDB-Xl.css +0 -1
- package/web/assets/TargetHealthNotice-CgkdTdhB.js +0 -47
- package/web/assets/TodoListView-CricdCfW.js +0 -1
- package/web/assets/Tooltip-o8ZqIb3L.js +0 -1
- package/web/assets/UnifiedPage-BWAyqj65.js +0 -69
- package/web/assets/UnifiedPage-CWXc_mo1.css +0 -1
- package/web/assets/appStore-CI1_L5OS.js +0 -3357
- package/web/assets/appStore-DQc2marq.css +0 -1
- package/web/assets/approvalText-Cy2UAUAQ.js +0 -2
- package/web/assets/arrow-up-right-BDsMFoNQ.js +0 -1
- package/web/assets/astryxBridge-CF_hpqC2.css +0 -1
- package/web/assets/astryxBridge-CH_c5xjo.js +0 -70
- package/web/assets/automationListSource-CB6AWkL_.js +0 -1
- package/web/assets/boardSurface-CLvEUjbF.js +0 -1
- package/web/assets/book-open-BLzEdGfu.js +0 -1
- package/web/assets/calendarNavStore-BHUNxDx8.js +0 -1
- package/web/assets/canvasPrefs-CvE7mgyq.js +0 -1
- package/web/assets/chatBoxSurface-CuuHLzs5.js +0 -1
- package/web/assets/circle-question-mark-BM4ZRxQS.js +0 -1
- package/web/assets/circle-x-DTcNGZDT.js +0 -1
- package/web/assets/code-xml-AE3mT4T5.js +0 -1
- package/web/assets/codingNavigation-B0kVsy4x.js +0 -53
- package/web/assets/codingNavigation-DHCidM4N.css +0 -1
- package/web/assets/create-1JI2I47p.js +0 -14
- package/web/assets/dashboardSurface-CIE5HybN.js +0 -1
- package/web/assets/deskCapture-COW7aG5Y.js +0 -1
- package/web/assets/emoji-DZ9CA_3l.css +0 -1
- package/web/assets/emoji-DphwSxPx.js +0 -1
- package/web/assets/floatingTocSurface-BOm2QYBK.js +0 -1
- package/web/assets/foldActions-DNbJPlPl.js +0 -1
- package/web/assets/folder-DotgUhYD.js +0 -1
- package/web/assets/folder-plus-aJgL9NeP.js +0 -1
- package/web/assets/gestures-dqncPOwo.js +0 -1
- package/web/assets/git-branch-CwR2qic6.js +0 -1
- package/web/assets/hack2gate-dark-Dx2RtDRI.jpg +0 -0
- package/web/assets/hack2gate-light-DRKq9tyS.jpg +0 -0
- package/web/assets/hand-XNkzNiW2.js +0 -1
- package/web/assets/hard-drive-CfWKRoAE.js +0 -1
- package/web/assets/i18n-CykmULlm.css +0 -1
- package/web/assets/i18n.generated-BwynSSMk.js +0 -15
- package/web/assets/imageStudio-CWgLpC_d.js +0 -2
- package/web/assets/imageStudio-DZ0qGU2s.css +0 -1
- package/web/assets/index-B65ULikK.js +0 -1
- package/web/assets/index-BIIeiIap.js +0 -1
- package/web/assets/index-BOzsniE1.js +0 -297
- package/web/assets/index-BfrjVzia.js +0 -13
- package/web/assets/index-Bi9UtjVz.js +0 -1
- package/web/assets/index-C1uilc9i.js +0 -1
- package/web/assets/index-C3Dc3Ivz.js +0 -1
- package/web/assets/index-CJF_Ld1Y.js +0 -1
- package/web/assets/index-CMARP4oV.js +0 -1
- package/web/assets/index-C_RsQVNm.js +0 -7
- package/web/assets/index-ChyxZMm8.js +0 -1
- package/web/assets/index-CoKcOaZg.js +0 -1
- package/web/assets/index-CuviSCbk.js +0 -1
- package/web/assets/index-Cw43kua8.js +0 -1
- package/web/assets/index-D1fu6XQN.js +0 -3
- package/web/assets/index-DG-hXb63.js +0 -1
- package/web/assets/index-DjnTfJpN.js +0 -1
- package/web/assets/index-Dtw0abst.js +0 -1
- package/web/assets/index-W3ErfZiX.js +0 -1
- package/web/assets/index-Yc56b3XX.js +0 -1
- package/web/assets/index-d4jCdYJH.js +0 -1
- package/web/assets/index-siHtlYTM.js +0 -1
- package/web/assets/launchpad-C2c1MSVX.css +0 -1
- package/web/assets/layout-grid-CraV7nhh.js +0 -1
- package/web/assets/linkFollow-BpvDWzUx.js +0 -8
- package/web/assets/list-tree-cLJw-jYQ.js +0 -1
- package/web/assets/lock-DBkXXwaI.js +0 -1
- package/web/assets/lock-open-C-9-AWct.js +0 -1
- package/web/assets/log-out-C8bDXj9P.js +0 -1
- package/web/assets/main-BiS_5wrB.css +0 -1
- package/web/assets/main-CMk6twzA.js +0 -20
- package/web/assets/markdownEditorSurface-Bql20IAf.css +0 -1
- package/web/assets/markdownEditorSurface-DgQ0TUWH.js +0 -3
- package/web/assets/message-square-plus-8pfimvem.js +0 -1
- package/web/assets/minus-CfA9fAN3.js +0 -1
- package/web/assets/mobileEntry-DS1vohuL.css +0 -1
- package/web/assets/mobileEntry-NcMcK0LV.js +0 -13
- package/web/assets/nativeDownload-CNtwSCy0.js +0 -1
- package/web/assets/pageChrome-BR4cfIaA.js +0 -1
- package/web/assets/pageChrome-BbUhILy0.css +0 -1
- package/web/assets/pen-tool-C5ftHCnm.js +0 -1
- package/web/assets/pencil-ehhM9_9k.js +0 -1
- package/web/assets/phoneList-B6gwUJZF.js +0 -9
- package/web/assets/phoneList-iRdfiKA8.css +0 -1
- package/web/assets/pluginChat-DTTWWiUS.js +0 -2
- package/web/assets/redo-2-DCEAgQlN.js +0 -1
- package/web/assets/rotate-ccw-DdkrbRAB.js +0 -1
- package/web/assets/selectionActions-BQD2kox1.js +0 -2
- package/web/assets/selectionBarSurface-CzUZmJDJ.js +0 -1
- package/web/assets/server-Ddu9f1k3.js +0 -1
- package/web/assets/sharePage-CNrm2xTC.js +0 -2
- package/web/assets/star-Dxv7XANS.js +0 -1
- package/web/assets/tableSurface-Bly1iCXc.js +0 -1
- package/web/assets/terminal-CAmmC9cV.js +0 -1
- package/web/assets/type-Dz6rnTvG.js +0 -1
- package/web/assets/undo-2-B7izWNb_.js +0 -1
- package/web/assets/unitOwnerAccess-D4nKS6Gg.js +0 -1
- package/web/assets/unitShim-2_2hhGxS.js +0 -5
- package/web/assets/upload-DqpRRAhG.js +0 -1
- package/web/assets/userSpaces-VFu4s05v.js +0 -1
- package/web/assets/viewportLock-3AOdDmwi.js +0 -631
- package/web/assets/viewportLock-djvL8fUQ.css +0 -1
- package/web/assets/zoom-in-Bf-eKTnH.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{r as v,j as d,R as Ot,a as pt,u as fo,b as ga,t as ya,L as va}from"./index-YuejkHoJ.js";import{c as ba}from"./client-DD5czSuF.js";import{d as xa,i as wa,s as Sa,r as Ta,a as Ca,b as Pa,u as ka,c as Aa,e as Ea,f as Ma,g as ja,h as Va,A as Ra,C as Da,V as La,o as Na,j as Ia,M as Oa,S as Fa,B as Ba,P as za,k as Ua,N as Wa,W as $a,T as _a,l as Ha,m as Ka,E as Ga}from"./viewportLock-cVUalJAI.js";import{u as Y,n as Ss,c as Ya,a as Xa,b as an,m as qa,d as Za,e as ve,f as Ts,g as Qa,h as mo,i as Ja,s as tl,Q as el,O as nl,p as sl,j as ln,k as il,r as ol,l as rl,o as al,q as ll,t as cl,v as ul,w as hl,x as dl}from"./appStore-BskcSDl6.js";import{u as be,b as po}from"./PluginToolCard-BXE5vA1h.js";import{F as fl}from"./UnifiedPage-6xbFLtXT.js";import{n as ml,N as pl,a as gl,u as yl,i as vl,b as bl,c as xl,d as wl,U as Cs,e as ae,f as je,g as Sl,h as Tl,j as Cl,k as Pl,S as kl,l as cn,m as Al,o as un,s as El}from"./pageStore-D_fKLv-o.js";import{H as go,o as Ml,f as jl,c as yo,h as Vl}from"./dbStore-Bc2lC8ZI.js";import{i as vo,R as Rl}from"./ipc-8cxXGSZK.js";import{r as Dl}from"./nativeSheetMenu-CVC51DzC.js";import"./i18n.generated-D4-Wu9Wh.js";import"./sessionTitle-BtZ1BteL.js";import"./ModelPill-DgyXBsL9.js";import"./upload-VtCrluEO.js";import"./MuseView-BVDlmM6i.js";import"./automationListSource-Cm09JKkK.js";import"./nativeDownload-DlnT8U-y.js";import"./react-DOzedx9n.js";import"./messages-CG7ywZ-K.js";import"./message-square-plus-CspBv9iG.js";import"./rotate-ccw-CyZpL7MX.js";import"./undo-2-C4ZCsMsx.js";import"./git-branch-DzGWffyD.js";import"./selectionActions-C2a8ImJm.js";import"./mediaPlayer-O9pVRl_k.js";import"./arrow-up-right-DEykpgsH.js";import"./CapabilityMenu-Dzn6RbB1.js";import"./folder-plus-Cmhq0GcR.js";import"./userSpaces-BpeYjLni.js";import"./code-xml-vTB4LtTf.js";import"./star-ZEpUQwnX.js";import"./layout-grid-CzxXbCDa.js";import"./folder-DiaFWdCg.js";import"./DashboardGridView-CBbYKcCo.js";import"./FloatingToc-iK08Qpjc.js";import"./MarkdownBlock-DjsGkPZ_.js";import"./index-CiQ59Kib.js";import"./linkFollow-J2c0wSgB.js";import"./listFold-B_2Xqxn_.js";import"./pageTree-DtDKozTg.js";import"./pluginExt-Byb64tQO.js";import"./CtxMenuButtons-CAiwQkOK.js";import"./phoneList-BLVdQcXY.js";import"./pen-tool-CV-FKFEZ.js";import"./pencil-BgF4Kiqp.js";import"./folder-minus-DUEOcs12.js";import"./type-CMyP4cKt.js";import"./redo-2-DWZTaEz-.js";import"./file-down-Cjo_T6By.js";import"./SettingsPage-fjxfS_Mt.js";import"./lock-open-DVWCLSZm.js";import"./canvasPrefs-CMulOS0k.js";import"./AutomationBuilder-CzBKmOiw.js";import"./gestures-Bx9M0le5.js";import"./Chrome-owLewFu4.js";import"./magnet-BmVcZ9U4.js";import"./tanguProbe-BboOas-a.js";import"./index-BQrMYjou.js";import"./create-DZWy4zBR.js";import"./launchpad-BX4jQyF4.js";import"./pdf.worker.min-CGb3BKV9.js";import"./zoom-in-C7R8s9x-.js";import"./minimize-2-Bq4vUin-.js";import"./InlineFiles-3g2jMUeA.js";import"./codeStudioStore-OswE1_s0.js";import"./chevron-up-C_EDOZzI.js";import"./pen-line-ho1GgAe2.js";import"./ViewSelectionBar-C5FDh7fO.js";import"./InlineAiPanel-CjYOW0_0.js";import"./GitCloneDialog-DfY0kqhP.js";import"./log-out-CdKTS7HC.js";import"./StudioGuestSurface-360CWUwf.js";/* empty css */import"./drawingStore-BD5m2eqn.js";import"./foldActions-utwZpRrA.js";const Mt=t=>(t??"").replace(/\s+/g," ").trim(),Ps=t=>t.tagName==="OPTION",bo=t=>t.parentElement?.tagName==="OPTGROUP"?t.parentElement:null,xo=t=>Mt(t.label||t.text),Ll=t=>!t.hidden&&!bo(t)?.hidden,wo=t=>t.disabled||!!bo(t)?.disabled,ks=new WeakSet;function Nl(t){const e=Mt(t.getAttribute("aria-label"));if(e)return e;for(const n of Array.from(t.labels??[])){const s=n.cloneNode(!0);s.querySelectorAll("select").forEach(r=>r.remove());const i=Mt(s.textContent);if(i)return i}return Mt(t.getAttribute("title"))}function Il(t,e){const n=t.options[e.index];!t.isConnected||t.disabled||!n||n.value!==e.value||xo(n)!==e.label||!Ll(n)||wo(n)||n.selected||(n.selected=!0,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}function Ol(t,e=""){const n=[];let s=null;const i=r=>{const o={index:r.index,value:r.value,label:xo(r)};return{id:`opt:${o.index}`,label:o.label,...r.selected?{checked:!0}:{},...wo(r)?{disabled:!0}:{},run:()=>Il(t,o)}};for(const r of Array.from(t.children))if(r.tagName==="OPTGROUP"){s=null;const o=r.hidden?[]:Array.from(r.children).filter(Ps).filter(a=>!a.hidden).map(i);o.length&&n.push({title:Mt(r.label),items:o})}else Ps(r)&&!r.hidden&&(s||n.push({items:s=[]}),s.push(i(r)));return n.length?{...e?{title:e}:{},sections:n}:null}const Fl=new Set([" ","Enter"]);function Bl(t={}){const e=n=>{const s=n.target;if(!s||s.tagName!=="SELECT"||s.multiple||s.size>1||s.disabled||(n.type==="keydown"?!Fl.has(n.key):n.button!==0)||!ml()||ks.has(s)||s.options.length>pl)return;const i=Ol(s,Nl(s)||Mt(t.titleOf?.(s)));i&&(n.preventDefault(),s.focus({preventScroll:!0}),Dl(i).then(r=>r,()=>!1).then(r=>{if(!r){ks.add(s);try{s.showPicker?.()}catch{}}}))};return document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",e,!0)}}const So={addListener:async(t,e)=>({remove:()=>{}}),minimizeApp:async()=>{},getLaunchUrl:async()=>{}},Wn=v.createContext({});function $n(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const zl=typeof window<"u",_n=zl?v.useLayoutEffect:v.useEffect,Ve=v.createContext(null);function Hn(t,e){t.indexOf(e)===-1&&t.push(e)}function xe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ct=(t,e,n)=>n>e?e:n<t?t:n;let Kn=()=>{};const ft={},To=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Co=t=>typeof t=="object"&&t!==null,Po=t=>/^0[^.\s]+$/u.test(t);function ko(t){let e;return()=>(e===void 0&&(e=t()),e)}const J=t=>t,Xt=(...t)=>t.reduce((e,n)=>s=>n(e(s))),$t=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class Gn{constructor(){this.subscriptions=[]}add(e){return Hn(this.subscriptions,e),()=>xe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,Q=t=>t/1e3,Ao=(t,e)=>e?t*(1e3/e):0,Eo=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ul=1e-7,Wl=12;function $l(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Eo(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Ul&&++a<Wl);return o}function qt(t,e,n,s){if(t===e&&n===s)return J;const i=r=>$l(r,0,1,t,n);return r=>r===0||r===1?r:Eo(i(r),e,s)}const Mo=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,jo=t=>e=>1-t(1-e),Vo=qt(.33,1.53,.69,.99),Yn=jo(Vo),Ro=Mo(Yn),Do=t=>t>=1?1:(t*=2)<1?.5*Yn(t):.5*(2-Math.pow(2,-10*(t-1))),Xn=t=>1-Math.sin(Math.acos(t)),Lo=jo(Xn),No=Mo(Xn),_l=qt(.42,0,1,1),Hl=qt(0,0,.58,1),Io=qt(.42,0,.58,1),Kl=t=>Array.isArray(t)&&typeof t[0]!="number",Oo=t=>Array.isArray(t)&&typeof t[0]=="number",Gl={linear:J,easeIn:_l,easeInOut:Io,easeOut:Hl,circIn:Xn,circInOut:No,circOut:Lo,backIn:Yn,backInOut:Ro,backOut:Vo,anticipate:Do},Yl=t=>typeof t=="string",As=t=>{if(Oo(t)){Kn(t.length===4);const[e,n,s,i]=t;return qt(e,n,s,i)}else if(Yl(t))return Gl[t];return t},te=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Xl(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){r.has(l)&&(u.schedule(l),t()),l(o)}const u={schedule:(l,c=!1,h=!1)=>{const p=h&&s?e:n;return c&&r.add(l),p.add(l),l},cancel:l=>{n.delete(l),r.delete(l)},process:l=>{if(o=l,s){i=!0;return}s=!0;const c=e;e=n,n=c,e.forEach(a),e.clear(),s=!1,i&&(i=!1,u.process(l))}};return u}const ql=40;function Fo(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=te.reduce((w,y)=>(w[y]=Xl(r),w),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:f,render:p,postRender:m}=o,g=()=>{const w=ft.useManualTiming,y=w?i.timestamp:performance.now();n=!1,w||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,ql),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),u.process(i),l.process(i),c.process(i),h.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},b=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:te.reduce((w,y)=>{const k=o[y];return w[y]=(P,j=!1,T=!1)=>(n||b(),k.schedule(P,j,T)),w},{}),cancel:w=>{for(let y=0;y<te.length;y++)o[te[y]].cancel(w)},state:i,steps:o}}const{schedule:L,cancel:mt,state:W,steps:Fe}=Fo(typeof requestAnimationFrame<"u"?requestAnimationFrame:J,!0);let le;function Zl(){le=void 0}const K={now:()=>(le===void 0&&K.set(W.isProcessing||ft.useManualTiming?W.timestamp:performance.now()),le),set:t=>{le=t,queueMicrotask(Zl)}},Bo=t=>e=>typeof e=="string"&&e.startsWith(t),zo=Bo("--"),Ql=Bo("var(--"),qn=t=>Ql(t)?Jl.test(t.split("/*")[0].trim()):!1,Jl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Es(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},_t={...Rt,transform:t=>ct(0,1,t)},ee={...Rt,default:1},Bt=t=>Math.round(t*1e5)/1e5,Zn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tc(t){return t==null}const ec=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qn=(t,e)=>n=>!!(typeof n=="string"&&ec.test(n)&&n.startsWith(t)||e&&!tc(n)&&Object.prototype.hasOwnProperty.call(n,e)),Uo=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Zn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},nc=t=>ct(0,255,t),Be={...Rt,transform:t=>Math.round(nc(t))},xt={test:Qn("rgb","red"),parse:Uo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Be.transform(t)+", "+Be.transform(e)+", "+Be.transform(n)+", "+Bt(_t.transform(s))+")"};function sc(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const hn={test:Qn("#"),parse:sc,transform:xt.transform},Zt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ut=Zt("deg"),lt=Zt("%"),A=Zt("px"),ic=Zt("vh"),oc=Zt("vw"),Ms={...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(t*100)},kt={test:Qn("hsl","hue"),parse:Uo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+lt.transform(Bt(e))+", "+lt.transform(Bt(n))+", "+Bt(_t.transform(s))+")"},B={test:t=>xt.test(t)||hn.test(t)||kt.test(t),parse:t=>xt.test(t)?xt.parse(t):kt.test(t)?kt.parse(t):hn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?xt.transform(t):kt.transform(t),getAnimatableNone:t=>{const e=B.parse(t);return e.alpha=0,B.transform(e)}},rc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ac(t){return isNaN(t)&&typeof t=="string"&&(t.match(Zn)?.length||0)+(t.match(rc)?.length||0)>0}const Wo="number",$o="color",lc="var",cc="var(",js="${}",uc=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function jt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(uc,u=>(B.test(u)?(s.color.push(r),i.push($o),n.push(B.parse(u))):u.startsWith(cc)?(s.var.push(r),i.push(lc),n.push(u)):(s.number.push(r),i.push(Wo),n.push(parseFloat(u))),++r,js)).split(js);return{values:n,split:a,indexes:s,types:i}}function hc(t){return jt(t).values}function _o({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===Wo?i+=Bt(s[r]):o===$o?i+=B.transform(s[r]):i+=s[r]}return i}}function dc(t){return _o(jt(t))}const fc=t=>typeof t=="number"?0:B.test(t)?B.getAnimatableNone(t):t,mc=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:fc(t);function pc(t){const e=jt(t);return _o(e)(e.values.map((s,i)=>mc(s,e.split[i])))}const st={test:ac,parse:hc,createTransformer:dc,getAnimatableNone:pc};function ze(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function gc({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;i=ze(u,a,t+1/3),r=ze(u,a,t),o=ze(u,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function we(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,Ue=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},yc=[hn,xt,kt],vc=t=>yc.find(e=>e.test(t));function Vs(t){const e=vc(t);if(!e)return!1;let n=e.parse(t);return e===kt&&(n=gc(n)),n}const Rs=(t,e)=>{const n=Vs(t),s=Vs(e);if(!n||!s)return we(t,e);const i={...n};return r=>(i.red=Ue(n.red,s.red,r),i.green=Ue(n.green,s.green,r),i.blue=Ue(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),xt.transform(i))},dn=new Set(["none","hidden"]);function bc(t,e){return dn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function xc(t,e){return n=>D(t,e,n)}function Jn(t){return typeof t=="number"?xc:typeof t=="string"?qn(t)?we:B.test(t)?Rs:Tc:Array.isArray(t)?Ho:typeof t=="object"?B.test(t)?Rs:wc:we}function Ho(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Jn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function wc(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Jn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Sc(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Tc=(t,e)=>{const n=st.createTransformer(e),s=jt(t),i=jt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?dn.has(t)&&!i.values.length||dn.has(e)&&!s.values.length?bc(t,e):Xt(Ho(Sc(s,i),i.values),n):we(t,e)};function Ko(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):Jn(t)(t,e)}const Cc=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>mt(e),now:()=>W.isProcessing?W.timestamp:K.now()}},Go=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Se=2e4;function ts(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Se;)e+=n,s=t.next(e);return e>=Se?1/0:e}function Pc(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ts(s),Se);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:Q(i)}}const O={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function fn(t,e){return t*Math.sqrt(1-e*e)}const kc=12;function Ac(t,e,n){let s=n;for(let i=1;i<kc;i++)s=s-t(s)/e(s);return s}const We=.001;function Ec({duration:t=O.duration,bounce:e=O.bounce,velocity:n=O.velocity,mass:s=O.mass}){let i,r,o=1-e;o=ct(O.minDamping,O.maxDamping,o),t=ct(O.minDuration,O.maxDuration,Q(t)),o<1?(i=l=>{const c=l*o,h=c*t,f=c-n,p=fn(l,o),m=Math.exp(-h);return We-f/p*m},r=l=>{const h=l*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,m=Math.exp(-h),g=fn(Math.pow(l,2),o);return(-i(l)+We>0?-1:1)*((f-p)*m)/g}):(i=l=>{const c=Math.exp(-l*t),h=(l-n)*t+1;return-We+c*h},r=l=>{const c=Math.exp(-l*t),h=(n-l)*(t*t);return c*h});const a=5/t,u=Ac(i,r,a);if(t=q(t),isNaN(u))return{stiffness:O.stiffness,damping:O.damping,duration:t};{const l=Math.pow(u,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Mc=["duration","bounce"],jc=["stiffness","damping","mass"];function Ds(t,e){return e.some(n=>t[n]!==void 0)}function Vc(t){let e={velocity:O.velocity,stiffness:O.stiffness,damping:O.damping,mass:O.mass,isResolvedFromDuration:!1,...t};if(!Ds(t,jc)&&Ds(t,Mc))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*ct(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:O.mass,stiffness:i,damping:r}}else{const n=Ec({...t,velocity:0});e={...e,...n,mass:O.mass},e.isResolvedFromDuration=!0}return e}function Te(t=O.visualDuration,e=O.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:f,isResolvedFromDuration:p}=Vc({...n,velocity:-Q(n.velocity||0)}),m=f||0,g=l/(2*Math.sqrt(u*c)),b=o-r,x=Q(Math.sqrt(u/c)),S=Math.abs(b)<5;s||(s=S?O.restSpeed.granular:O.restSpeed.default),i||(i=S?O.restDelta.granular:O.restDelta.default);let w,y,k,P,j,T;if(g<1)k=fn(x,g),P=(m+g*x*b)/k,w=E=>{const V=Math.exp(-g*x*E);return o-V*(P*Math.sin(k*E)+b*Math.cos(k*E))},j=g*x*P+b*k,T=g*x*b-P*k,y=E=>Math.exp(-g*x*E)*(j*Math.sin(k*E)+T*Math.cos(k*E));else if(g===1){w=V=>o-Math.exp(-x*V)*(b+(m+x*b)*V);const E=m+x*b;y=V=>Math.exp(-x*V)*(x*E*V-m)}else{const E=x*Math.sqrt(g*g-1);w=H=>{const tt=Math.exp(-g*x*H),Z=Math.min(E*H,300);return o-tt*((m+g*x*b)*Math.sinh(Z)+E*b*Math.cosh(Z))/E};const V=(m+g*x*b)/E,N=g*x*V-b*E,X=g*x*b-V*E;y=H=>{const tt=Math.exp(-g*x*H),Z=Math.min(E*H,300);return tt*(N*Math.sinh(Z)+X*Math.cosh(Z))}}const M={calculatedDuration:p&&h||null,velocity:E=>q(y(E)),next:E=>{if(!p&&g<1){const N=Math.exp(-g*x*E),X=Math.sin(k*E),H=Math.cos(k*E),tt=o-N*(P*X+b*H),Z=q(N*(j*X+T*H));return a.done=Math.abs(Z)<=s&&Math.abs(o-tt)<=i,a.value=a.done?o:tt,a}const V=w(E);if(p)a.done=E>=h;else{const N=q(y(E));a.done=Math.abs(N)<=s&&Math.abs(o-V)<=i}return a.value=a.done?o:V,a},toString:()=>{const E=Math.min(ts(M),Se),V=Go(N=>M.next(E*N).value,E,30);return E+"ms "+V},toTransition:()=>{}};return M}Te.applyToOptions=t=>{const e=Pc(t,100,Te);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};const Rc=5;function Yo(t,e,n){const s=Math.max(e-Rc,0);return Ao(n-t(s),e-s)}function mn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},p=T=>a!==void 0&&T<a||u!==void 0&&T>u,m=T=>a===void 0?u:u===void 0||Math.abs(a-T)<Math.abs(u-T)?a:u;let g=n*e;const b=h+g,x=o===void 0?b:o(b);x!==b&&(g=x-h);const S=T=>-g*Math.exp(-T/s),w=T=>x+S(T),y=T=>{const M=S(T),E=w(T);f.done=Math.abs(M)<=l,f.value=f.done?x:E};let k,P;const j=T=>{p(f.value)&&(k=T,P=Te({keyframes:[f.value,m(f.value)],velocity:Yo(w,T,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:c}))};return j(0),{calculatedDuration:null,next:T=>{let M=!1;return!P&&k===void 0&&(M=!0,y(T),j(T)),k!==void 0&&T>=k?P.next(T-k):(!M&&y(T),f)}}}function Dc(t,e,n){const s=[],i=n||ft.mix||Ko,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||J:e;a=Xt(u,a)}s.push(a)}return s}function Lc(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Kn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Dc(e,s,i),u=a.length,l=c=>{if(o&&c<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=$t(t[h],t[h+1],c);return a[h](f)};return n?c=>l(ct(t[0],t[r-1],c)):l}function Nc(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=$t(0,e,s);t.push(D(n,1,i))}}function Ic(t){const e=[0];return Nc(e,t.length-1),e}function Oc(t,e){return t.map(n=>n*e)}function Fc(t,e){return t.map(()=>e||Io).splice(0,t.length-1)}function zt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Kl(s)?s.map(As):As(s),r={done:!1,value:e[0]},o=Oc(n&&n.length===e.length?n:Ic(e),t),a=Lc(o,e,{ease:Array.isArray(i)?i:Fc(e,i)});return{calculatedDuration:t,next:u=>(r.value=a(u),r.done=u>=t,r)}}const Bc=t=>t!==null;function Re(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Bc),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const zc={decay:mn,inertia:mn,tween:zt,keyframes:zt,spring:Te};function Xo(t){typeof t.type=="string"&&(t.type=zc[t.type])}class es{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Uc=t=>t/100;class Ce extends es{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==K.now()&&this.tick(K.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Xo(e);const{type:n=zt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const u=n||zt;u!==zt&&typeof a[0]!="number"&&(this.mixKeyframes=Xt(Uc,Ko(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=ts(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?x<0:x>i;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,y=s;if(h){const T=Math.min(this.currentTime,i)/a;let M=Math.floor(T),E=T%1;!E&&T>=1&&(E=1),E===1&&M--,M=Math.min(M,h+1),M%2&&(f==="reverse"?(E=1-E,p&&(E-=p/a)):f==="mirror"&&(y=o)),w=ct(0,1,E)*a}let k;S?(this.delayState.value=c[0],k=this.delayState):k=y.next(w),r&&!S&&(k.value=r(k.value));let{done:P}=k;!S&&u!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return j&&m!==mn&&(k.value=Re(c,this.options,b,this.speed)),g&&g(k.value),j&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return Q(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Q(e)}get time(){return Q(this.currentTime)}set time(e){e=q(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Yo(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(K.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Q(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Cc,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(K.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Wc(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const wt=t=>t*180/Math.PI,pn=t=>{const e=wt(Math.atan2(t[1],t[0]));return gn(e)},$c={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pn,rotateZ:pn,skewX:t=>wt(Math.atan(t[1])),skewY:t=>wt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},gn=t=>(t=t%360,t<0&&(t+=360),t),Ls=pn,Ns=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Is=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),_c={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ns,scaleY:Is,scale:t=>(Ns(t)+Is(t))/2,rotateX:t=>gn(wt(Math.atan2(t[6],t[5]))),rotateY:t=>gn(wt(Math.atan2(-t[2],t[0]))),rotateZ:Ls,rotate:Ls,skewX:t=>wt(Math.atan(t[4])),skewY:t=>wt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function yn(t){return t.includes("scale")?1:0}function vn(t,e){if(!t||t==="none")return yn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=_c,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=$c,i=a}if(!i)return yn(e);const r=s[e],o=i[1].split(",").map(Kc);return typeof r=="function"?r(o):o[r]}const Hc=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return vn(n,e)};function Kc(t){return parseFloat(t.trim())}const Dt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Lt=new Set([...Dt,"pathRotation"]),Os=t=>t===Rt||t===A,Gc=new Set(["x","y","z"]),Yc=Dt.filter(t=>!Gc.has(t));function Xc(t){const e=[];return Yc.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const dt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>vn(e,"x"),y:(t,{transform:e})=>vn(e,"y")};dt.translateX=dt.x;dt.translateY=dt.y;const Tt=new Set;let bn=!1,xn=!1,wn=!1;function qo(){if(xn){const t=Array.from(Tt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Xc(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}xn=!1,bn=!1,Tt.forEach(t=>t.complete(wn)),Tt.clear()}function Zo(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}function qc(){wn=!0,Zo(),qo(),wn=!1}class ns{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),bn||(bn=!0,L.read(Zo),L.resolveKeyframes(qo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Wc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Tt.delete(this)}cancel(){this.state==="scheduled"&&(Tt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Zc=t=>t.startsWith("--");function Qo(t,e,n){Zc(e)?t.style.setProperty(e,n):t.style[e]=n}const Qc={};function Jo(t,e){const n=ko(t);return()=>Qc[e]??n()}const Jc=Jo(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),tr=Jo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ft=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Fs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ft([0,.65,.55,1]),circOut:Ft([.55,0,1,.45]),backIn:Ft([.31,.01,.66,-.59]),backOut:Ft([.33,1.53,.69,.99])};function er(t,e){if(t)return typeof t=="function"?tr()?Go(t,e):"ease-out":Oo(t)?Ft(t):Array.isArray(t)?t.map(n=>er(n,e)||Fs.easeOut):Fs[t]}function tu(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=er(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(c,f)}function nr(t){return typeof t=="function"&&"applyToOptions"in t}function eu({type:t,...e}){return nr(t)&&tr()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class sr extends es{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Kn(typeof e.type!="string");const l=eu(e);this.animation=tu(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=Re(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Qo(n,s,c),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Q(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Q(e)}get time(){return Q(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=q(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Jc()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),J):i(this)}}const ir={anticipate:Do,backInOut:Ro,circInOut:No};function nu(t){return t in ir}function su(t){typeof t.ease=="string"&&nu(t.ease)&&(t.ease=ir[t.ease])}const $e=10;class iu extends sr{constructor(e){su(e),Xo(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Ce({...o,autoplay:!1}),u=Math.max($e,K.now()-this.startTime),l=ct(0,$e,u-$e),c=a.sample(u).value,{name:h}=this.options;r&&h&&Qo(r,h,c),n.setWithVelocity(a.sample(Math.max(0,u-l)).value,c,l),a.stop()}}const Bs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(st.test(t)||t==="0")&&!t.startsWith("url("));function ou(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ru(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Bs(i,e),a=Bs(r,e);return!o||!a?!1:ou(t)||(n==="spring"||nr(n))&&s}function Sn(t){t.duration=0,t.type="keyframes"}const or=new Set(["opacity","clipPath","filter","transform"]),au=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lu(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&au.test(t[e]))return!0;return!1}const cu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),uu=ko(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function hu(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return uu()&&n&&(or.has(n)||cu.has(n)&&lu(a))&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const du=40;class fu extends es{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=K.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:u,motionValue:l,element:c,...h},p=c?.KeyframeResolver||ns;this.keyframeResolver=new p(a,(m,g,b)=>this.onKeyframesResolved(m,g,f,!b),u,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=s;this.resolvedAt=K.now();let h=!0;ru(e,r,o,a)||(h=!1,(ft.instantAnimations||!u)&&c?.(Re(e,s,n)),e[0]=e[e.length-1],Sn(s),s.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>du?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},m=h&&!l&&hu(p),g=p.motionValue?.owner?.current;let b;if(m)try{b=new iu({...p,element:g})}catch{b=new Ce(p)}else b=new Ce(p);b.finished.then(()=>{this.notifyFinished()}).catch(J),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),qc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function rr(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,c)=>l.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const zs=30,mu=t=>!isNaN(parseFloat(t));class pu{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=K.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=K.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=mu(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Gn);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=K.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>zs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zs);return Ao(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(t,e){return new pu(t,e)}function ar(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function ss(t,e){const n=t?.[e]??t?.default??t;return n!==t?ar(n,t):n}const gu={type:"spring",stiffness:500,damping:25,restSpeed:10},yu=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),vu={type:"keyframes",duration:.8},bu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},xu=(t,{keyframes:e})=>e.length>2?vu:Lt.has(t)?t.startsWith("scale")?yu(e[1]):gu:bu,wu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Su(t){for(const e in t)if(!wu.has(e))return!0;return!1}const is=(t,e,n,s={},i,r)=>o=>{const a=ss(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-q(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Su(a)||Object.assign(c,xu(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Sn(c),c.delay===0&&(h=!0)),(ft.instantAnimations||ft.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Sn(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Re(c.keyframes,a);if(f!==void 0){L.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new Ce(c):new fu(c)},Tu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cu(t){const e=Tu.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function lr(t,e,n=1){const[s,i]=Cu(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return To(o)?parseFloat(o):o}return qn(i)?lr(i,e,n+1):i}function Us(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function os(t,e,n,s){if(typeof e=="function"){const[i,r]=Us(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Us(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Ct(t,e,n){const s=t.getProps();return os(s,e,n!==void 0?n:s.custom,t)}const cr=new Set(["width","height","top","left","right","bottom",...Dt]),Tn=t=>Array.isArray(t);function Pu(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function ku(t){return Tn(t)?t[t.length-1]||0:t}function Au(t,e){const n=Ct(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=ku(r[o]);Pu(t,o,a)}}const $=t=>!!(t&&t.getVelocity);function Eu(t){return!!($(t)&&t.add)}function Cn(t,e){const n=t.getValue("willChange");if(Eu(n))return n.add(e);if(!n&&ft.WillChange){const s=new ft.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function rs(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Mu="framerAppearId",ur="data-"+rs(Mu);function hr(t){return t.props[ur]}function ju({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function dr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?ar(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;s&&(r=s);const h=[],f=i&&t.animationState&&t.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(t,a,r,n,h);for(const m in a){const g=t.getValue(m,t.latestValues[m]??null),b=a[m];if(b===void 0||f&&ju(f,m))continue;const x={delay:n,...ss(r||{},m)};c&&(x.skipAnimations=!0);const S=g.get();if(S!==void 0&&!g.isAnimating()&&!Array.isArray(b)&&b===S&&!x.velocity){L.update(()=>g.set(b));continue}let w=!1;if(window.MotionHandoffAnimation){const P=hr(t);if(P){const j=window.MotionHandoffAnimation(P,m,L);j!==null&&(x.startTime=j,w=!0)}}Cn(t,m);const y=l??t.shouldReduceMotion;g.start(is(m,g,b,y&&cr.has(m)?{type:!1}:x,t,w));const k=g.animation;k&&h.push(k)}if(o){const m=()=>L.update(()=>{o&&Au(t,o)});h.length?Promise.all(h).then(m):m()}return h}function Pn(t,e,n={}){const s=Ct(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(dr(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:l=0,staggerChildren:c,staggerDirection:h}=i;return Vu(t,e,u,l,c,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,l]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>l())}else return Promise.all([r(),o(n.delay)])}function Vu(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Pn(u,e,{...o,delay:n+(typeof s=="function"?0:s)+rr(t.variantChildren,u,s,i,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Ru(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Pn(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Pn(t,e,n);else{const i=typeof e=="function"?Ct(t,e,n.custom):e;s=Promise.all(dr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Du={test:t=>t==="auto",parse:t=>t},fr=t=>e=>e.test(t),mr=[Rt,A,lt,ut,oc,ic,Du],Ws=t=>mr.find(fr(t));function Lu(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Po(t):!0}const Nu=new Set(["brightness","contrast","saturate","opacity"]);function Iu(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Zn)||[];if(!s)return t;const i=n.replace(s,"");let r=Nu.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ou=/\b([a-z-]*)\(.*?\)/gu,kn={...st,getAnimatableNone:t=>{const e=t.match(Ou);return e?e.map(Iu).join(" "):t}},An={...st,getAnimatableNone:t=>{const e=st.parse(t);return st.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},$s={...Rt,transform:Math.round},Fu={rotate:ut,pathRotation:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scale:ee,scaleX:ee,scaleY:ee,scaleZ:ee,skew:ut,skewX:ut,skewY:ut,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:_t,originX:Ms,originY:Ms,originZ:A},Pe={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,...Fu,zIndex:$s,fillOpacity:_t,strokeOpacity:_t,numOctaves:$s},Bu={...Pe,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:kn,WebkitFilter:kn,mask:An,WebkitMask:An},pr=t=>Bu[t],zu=new Set([kn,An]);function gr(t,e){let n=pr(t);return zu.has(n)||(n=st),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Uu=new Set(["auto","none","0"]);function Wu(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Uu.has(r)&&jt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=gr(n,i)}class $u extends ns{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),qn(h))){const f=lr(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!cr.has(s)||e.length!==2)return;const[i,r]=e,o=Ws(i),a=Ws(r),u=Es(i),l=Es(r);if(u!==l&&dt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Os(o)&&Os(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else dt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Lu(e[i]))&&s.push(i);s.length&&Wu(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=dt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=dt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}const as=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function yr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const En=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ce(t){return Co(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ls}=Fo(queueMicrotask,!1),nt={x:!1,y:!1};function vr(){return nt.x||nt.y}function _u(t){return t==="x"||t==="y"?nt[t]?null:(nt[t]=!0,()=>{nt[t]=!1}):nt.x||nt.y?null:(nt.x=nt.y=!0,()=>{nt.x=nt.y=!1})}function br(t,e){const n=yr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Hu(t){return!(t.pointerType==="touch"||vr())}function Ku(t,e,n={}){const[s,i,r]=br(t,n);return s.forEach(o=>{let a=!1,u=!1,l;const c=()=>{o.removeEventListener("pointerleave",m)},h=b=>{l&&(l(b),l=void 0),c()},f=b=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(b))},p=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=b=>{if(b.pointerType!=="touch"){if(a){u=!0;return}h(b)}},g=b=>{if(!Hu(b))return;u=!1;const x=e(o,b);typeof x=="function"&&(l=x,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",p,i)}),r}const xr=(t,e)=>e?t===e?!0:xr(t,e.parentElement):!1,cs=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Gu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yu(t){return Gu.has(t.tagName)||t.isContentEditable===!0}const Xu=new Set(["INPUT","SELECT","TEXTAREA"]);function qu(t){return Xu.has(t.tagName)||t.isContentEditable===!0}const ue=new WeakSet;function _s(t){return e=>{e.key==="Enter"&&t(e)}}function _e(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Zu=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=_s(()=>{if(ue.has(n))return;_e(n,"down");const i=_s(()=>{_e(n,"up")}),r=()=>_e(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Hs(t){return cs(t)&&!vr()}const Ks=new WeakSet;function Qu(t,e,n={}){const[s,i,r]=br(t,n),o=a=>{const u=a.currentTarget;if(!Hs(a)||Ks.has(a))return;ue.add(u),n.stopPropagation&&Ks.add(a);const l=e(u,a),c={...i,capture:!0},h=(m,g)=>{window.removeEventListener("pointerup",f,c),window.removeEventListener("pointercancel",p,c),ue.has(u)&&ue.delete(u),Hs(m)&&typeof l=="function"&&l(m,{success:g})},f=m=>{h(m,u===window||u===document||n.useGlobalTarget||xr(u,m.target))},p=m=>{h(m,!1)};window.addEventListener("pointerup",f,c),window.addEventListener("pointercancel",p,c)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ce(a)&&(a.addEventListener("focus",l=>Zu(l,i)),!Yu(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function us(t){return Co(t)&&"ownerSVGElement"in t}const he=new WeakMap;let de;const wr=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:us(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ju=wr("inline","width","offsetWidth"),th=wr("block","height","offsetHeight");function eh({target:t,borderBoxSize:e}){he.get(t)?.forEach(n=>{n(t,{get width(){return Ju(t,e)},get height(){return th(t,e)}})})}function nh(t){t.forEach(eh)}function sh(){typeof ResizeObserver>"u"||(de=new ResizeObserver(nh))}function ih(t,e){de||sh();const n=yr(t);return n.forEach(s=>{let i=he.get(s);i||(i=new Set,he.set(s,i)),i.add(e),de?.observe(s)}),()=>{n.forEach(s=>{const i=he.get(s);i?.delete(e),i?.size||de?.unobserve(s)})}}const fe=new Set;let At;function oh(){At=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};fe.forEach(e=>e(t))},window.addEventListener("resize",At)}function rh(t){return fe.add(t),At||oh(),()=>{fe.delete(t),!fe.size&&typeof At=="function"&&(window.removeEventListener("resize",At),At=void 0)}}function Gs(t,e){return typeof t=="function"?rh(t):ih(t,e)}function ah(t){return us(t)&&t.tagName==="svg"}const lh=[...mr,B,st],ch=t=>lh.find(fr(t)),Ys=()=>({translate:0,scale:1,origin:0,originPoint:0}),Et=()=>({x:Ys(),y:Ys()}),Xs=()=>({min:0,max:0}),z=()=>({x:Xs(),y:Xs()}),uh=new WeakMap;function De(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ht(t){return typeof t=="string"||Array.isArray(t)}const hs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ds=["initial",...hs];function Le(t){return De(t.animate)||ds.some(e=>Ht(t[e]))}function Sr(t){return!!(Le(t)||t.variants)}function hh(t,e,n){for(const s in e){const i=e[s],r=n[s];if($(i))t.addValue(s,i);else if($(r))t.addValue(s,Vt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Vt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Mn={current:null},Tr={current:!1},dh=typeof window<"u";function fh(){if(Tr.current=!0,!!dh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Mn.current=t.matches;t.addEventListener("change",e),e()}else Mn.current=!1}const qs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ke={};function Cr(t){ke=t}function mh(){return ke}class ph{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ns,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=K.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,L.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Le(n),this.isVariantNode=Sr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];l[p]!==void 0&&$(m)&&m.set(l[p])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,uh.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Tr.current||fh(),this.shouldReduceMotion=Mn.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),mt(this.notifyUpdate),mt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&or.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:u,ease:l,duration:c}=n.accelerate,h=new sr({element:this.current,name:e,keyframes:a,times:u,ease:l,duration:q(c)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=Lt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ke){const n=ke[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<qs.length;s++){const i=qs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=hh(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Vt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(To(s)||Po(s))?s=parseFloat(s):!ch(s)&&st.test(n)&&(s=gr(e,n)),this.setBaseTarget(e,$(s)?s.get():s)),$(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=os(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!$(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Gn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ls.render(this.render)}}class Pr extends ph{constructor(){super(...arguments),this.KeyframeResolver=$u}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;$(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class gt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function kr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function gh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function yh(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function He(t){return t===void 0||t===1}function jn({scale:t,scaleX:e,scaleY:n}){return!He(t)||!He(e)||!He(n)}function bt(t){return jn(t)||Ar(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ar(t){return Zs(t.x)||Zs(t.y)}function Zs(t){return t&&t!=="0%"}function Ae(t,e,n){const s=t-n,i=e*s;return n+i}function Qs(t,e,n,s,i){return i!==void 0&&(t=Ae(t,i,s)),Ae(t,n,s)+e}function Vn(t,e=0,n=1,s,i){t.min=Qs(t.min,e,n,s,i),t.max=Qs(t.max,e,n,s,i)}function Er(t,{x:e,y:n}){Vn(t.x,e.translate,e.scale,e.originPoint),Vn(t.y,n.translate,n.scale,n.originPoint)}const Js=.999999999999,ti=1.0000000000001;function vh(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:u}=r.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(at(t.x,-r.scroll.offset.x),at(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Er(t,o)),s&&bt(r.latestValues)&&me(t,r.latestValues,r.layout?.layoutBox))}e.x<ti&&e.x>Js&&(e.x=1),e.y<ti&&e.y>Js&&(e.y=1)}function at(t,e){t.min+=e,t.max+=e}function ei(t,e,n,s,i=.5){const r=D(t.min,t.max,i);Vn(t,e,n,r,s)}function ni(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function me(t,e,n){const s=n??t;ei(t.x,ni(e.x,s.x),e.scaleX,e.scale,e.originX),ei(t.y,ni(e.y,s.y),e.scaleY,e.scale,e.originY)}function Mr(t,e){return kr(yh(t.getBoundingClientRect(),e))}function bh(t,e,n){const s=Mr(t,n),{scroll:i}=e;return i&&(at(s.x,i.offset.x),at(s.y,i.offset.y)),s}const xh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wh=Dt.length;function Sh(t,e,n){let s="",i=!0;for(let o=0;o<wh;o++){const a=Dt[o],u=t[a];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(a.startsWith("scale")?1:0);else{const c=parseFloat(u);l=a.startsWith("scale")?c===1:c===0}if(!l||n){const c=En(u,Pe[a]);if(!l){i=!1;const h=xh[a]||a;s+=`${h}(${c}) `}n&&(e[a]=c)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${En(r,Pe.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function fs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const u in e){const l=e[u];if(Lt.has(u)){o=!0;continue}else if(zo(u)){i[u]=l;continue}else{const c=En(l,Pe[u]);u.startsWith("origin")?(a=!0,r[u]=c):s[u]=c}}if(e.transform||(o||n?s.transform=Sh(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:u="50%",originY:l="50%",originZ:c=0}=r;s.transformOrigin=`${u} ${l} ${c}`}}function jr(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function si(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const It={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(A.test(t))t=parseFloat(t);else return t;const n=si(t,e.target.x),s=si(t,e.target.y);return`${n}% ${s}%`}},Th={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=st.parse(t);if(i.length>5)return s;const r=st.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=u;const l=D(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),r(i)}},Rn={borderRadius:{...It,applyTo:[...as]},borderTopLeftRadius:It,borderTopRightRadius:It,borderBottomLeftRadius:It,borderBottomRightRadius:It,boxShadow:Th};function Vr(t,{layout:e,layoutId:n}){return Lt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Rn[t]||t==="opacity")}function ms(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)($(s[o])||i&&$(i[o])||Vr(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Ch(t){return window.getComputedStyle(t)}class Ph extends Pr{constructor(){super(...arguments),this.type="html",this.renderInstance=jr}readValueFromInstance(e,n){if(Lt.has(n))return this.projection?.isProjecting?yn(n):Hc(e,n);{const s=Ch(e),i=(zo(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Mr(e,n)}build(e,n,s){fs(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return ms(e,n,s)}}const kh={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ah={offset:"strokeDashoffset",array:"strokeDasharray"};function Eh(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?kh:Ah;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Mh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},u,l,c){if(fs(t,a,l),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const p of Mh)h[p]!==void 0&&(f[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Eh(h,i,r,o,!1)}const Dr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Lr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function jh(t,e,n,s){jr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Dr.has(i)?i:rs(i),e.attrs[i])}function Nr(t,e,n){const s=ms(t,e,n);for(const i in t)if($(t[i])||$(e[i])){const r=Dt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Vh extends Pr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Lt.has(n)){const s=pr(n);return s&&s.default||0}return n=Dr.has(n)?n:rs(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Nr(e,n,s)}build(e,n,s){Rr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){jh(e,n,s,i)}mount(e){this.isSVGTag=Lr(e.tagName),super.mount(e)}}const Rh=ds.length;function Ir(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Ir(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Rh;n++){const s=ds[n],i=t.props[s];(Ht(i)||i===!1)&&(e[s]=i)}return e}function Or(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Dh=[...hs].reverse(),Lh=hs.length;function Nh(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ru(t,n,s)))}function Ih(t){let e=Nh(t),n=ii(),s=!0,i=!1;const r=l=>(c,h)=>{const f=Ct(t,h,l==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:p,transitionEnd:m,...g}=f;c={...c,...g,...m}}return c};function o(l){e=l(t)}function a(l){const{props:c}=t,h=Ir(t.parent)||{},f=[],p=new Set;let m={},g=1/0;for(let x=0;x<Lh;x++){const S=Dh[x],w=n[S],y=c[S]!==void 0?c[S]:h[S],k=Ht(y),P=S===l?w.isActive:null;P===!1&&(g=x);let j=y===h[S]&&y!==c[S]&&k;if(j&&(s||i)&&t.manuallyAnimateOnMount&&(j=!1),w.protectedKeys={...m},!w.isActive&&P===null||!y&&!w.prevProp||De(y)||typeof y=="boolean")continue;if(S==="exit"&&w.isActive&&P!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const T=Oh(w.prevProp,y);let M=T||S===l&&w.isActive&&!j&&k||x>g&&k,E=!1;const V=Array.isArray(y)?y:[y];let N=V.reduce(r(S),{});P===!1&&(N={});const{prevResolvedValues:X={}}=w,H={...X,...N},tt=F=>{M=!0,p.has(F)&&(E=!0,p.delete(F)),w.needsAnimating[F]=!0;const U=t.getValue(F);U&&(U.liveStyle=!1)};for(const F in H){const U=N[F],it=X[F];if(m.hasOwnProperty(F))continue;let ot=!1;Tn(U)&&Tn(it)?ot=!Or(U,it)||T:ot=U!==it,ot?U!=null?tt(F):p.add(F):U!==void 0&&p.has(F)?tt(F):w.protectedKeys[F]=!0}w.prevProp=y,w.prevResolvedValues=N,w.isActive&&(m={...m,...N}),(s||i)&&t.blockInitialAnimation&&(M=!1);const Z=j&&T;M&&(!Z||E)&&f.push(...V.map(F=>{const U={type:S};if(typeof F=="string"&&(s||i)&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:it}=t,ot=Ct(it,F);if(it.enteringChildren&&ot){const{delayChildren:Oe}=ot.transition||{};U.delay=rr(it.enteringChildren,t,Oe)}}return{animation:F,options:U}}))}if(p.size){const x={};if(typeof c.initial!="boolean"){const S=Ct(t,Array.isArray(c.initial)?c.initial[0]:c.initial);S&&S.transition&&(x.transition=S.transition)}p.forEach(S=>{const w=t.getBaseTarget(S),y=t.getValue(S);y&&(y.liveStyle=!0),x[S]=w??null}),f.push({animation:x})}let b=!!f.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,i=!1,b?e(f):Promise.resolve()}function u(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const h=a(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ii(),i=!0}}}function Oh(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Or(e,t):!1}function yt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ii(){return{animate:yt(!0),whileInView:yt(),whileHover:yt(),whileTap:yt(),whileDrag:yt(),whileFocus:yt(),exit:yt()}}function Dn(t,e){t.min=e.min,t.max=e.max}function et(t,e){Dn(t.x,e.x),Dn(t.y,e.y)}function oi(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Fr=1e-4,Fh=1-Fr,Bh=1+Fr,Br=.01,zh=0-Br,Uh=0+Br;function G(t){return t.max-t.min}function Wh(t,e,n){return Math.abs(t-e)<=n}function ri(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=G(n)/G(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Fh&&t.scale<=Bh||isNaN(t.scale))&&(t.scale=1),(t.translate>=zh&&t.translate<=Uh||isNaN(t.translate))&&(t.translate=0)}function Ut(t,e,n,s){ri(t.x,e.x,n.x,s?s.originX:void 0),ri(t.y,e.y,n.y,s?s.originY:void 0)}function ai(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+G(e)}function $h(t,e,n,s){ai(t.x,e.x,n.x,s?.x),ai(t.y,e.y,n.y,s?.y)}function li(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+G(e)}function Ee(t,e,n,s){li(t.x,e.x,n.x,s?.x),li(t.y,e.y,n.y,s?.y)}function ci(t,e,n,s,i){return t-=e,t=Ae(t,1/n,s),i!==void 0&&(t=Ae(t,1/i,s)),t}function _h(t,e=0,n=1,s=.5,i,r=t,o=t){if(lt.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=ci(t.min,e,n,a,i),t.max=ci(t.max,e,n,a,i)}function ui(t,e,[n,s,i],r,o){_h(t,e[n],e[s],e[i],e.scale,r,o)}const Hh=["x","scaleX","originX"],Kh=["y","scaleY","originY"];function hi(t,e,n,s){ui(t.x,e,Hh,n?n.x:void 0,s?s.x:void 0),ui(t.y,e,Kh,n?n.y:void 0,s?s.y:void 0)}function di(t){return t.translate===0&&t.scale===1}function zr(t){return di(t.x)&&di(t.y)}function fi(t,e){return t.min===e.min&&t.max===e.max}function Gh(t,e){return fi(t.x,e.x)&&fi(t.y,e.y)}function mi(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ur(t,e){return mi(t.x,e.x)&&mi(t.y,e.y)}function pi(t){return G(t.x)/G(t.y)}function gi(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function rt(t){return[t("x"),t("y")]}function Yh(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:c,pathRotation:h,rotateX:f,rotateY:p,skewX:m,skewY:g}=n;l&&(s=`perspective(${l}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotate(${h}deg) `),f&&(s+=`rotateX(${f}deg) `),p&&(s+=`rotateY(${p}deg) `),m&&(s+=`skewX(${m}deg) `),g&&(s+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(s+=`scale(${a}, ${u})`),s||"none"}const Xh=as.length,yi=t=>typeof t=="string"?parseFloat(t):t,vi=t=>typeof t=="number"||A.test(t);function qh(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,Zh(s)),t.opacityExit=D(e.opacity??1,0,Qh(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<Xh;o++){const a=as[o];let u=bi(e,a),l=bi(n,a);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||vi(u)===vi(l)?(t[a]=Math.max(D(yi(u),yi(l),s),0),(lt.test(l)||lt.test(u))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function bi(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Zh=Wr(0,.5,Lo),Qh=Wr(.5,.95,J);function Wr(t,e,n){return s=>s<t?0:s>e?1:n($t(t,e,s))}function Jh(t,e,n){const s=$(t)?t:Vt(t);return s.start(is("",s,e,n)),s.animation}function Kt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}const td=(t,e)=>t.depth-e.depth;class ed{constructor(){this.children=[],this.isDirty=!1}add(e){Hn(this.children,e),this.isDirty=!0}remove(e){xe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(td),this.isDirty=!1,this.children.forEach(e)}}function nd(t,e){const n=K.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(mt(s),t(r-e))};return L.setup(s,!0),()=>mt(s)}function pe(t){return $(t)?t.get():t}class sd{constructor(){this.members=[]}add(e){Hn(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(xe(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(xe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ge={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ke=["","X","Y","Z"],id=1e3;let od=0;function Ge(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function $r(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=hr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&$r(s)}function _r({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=od++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ld),this.nodes.forEach(md),this.nodes.forEach(pd),this.nodes.forEach(cd)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new ed)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Gn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const u=this.eventHandlers.get(o);u&&u.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=us(o)&&!ah(o),this.instance=o;const{layoutId:a,layout:u,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;L.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,c&&c(),c=nd(f,250),ge.hasAnimatedSinceResize&&(ge.hasAnimatedSinceResize=!1,this.nodes.forEach(Si)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||xd,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=l.getProps(),x=!this.targetLayout||!Ur(this.targetLayout,p),S=!h&&f;if(this.options.layoutRoot||this.resumeFrom||S||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...ss(m,"layout"),onPlay:g,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(c,S,w.path)}else h||Si(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),mt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(gd),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$r(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(hd),this.nodes.forEach(xi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wi);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(dd),this.nodes.forEach(fd),this.nodes.forEach(rd),this.nodes.forEach(ad)):this.nodes.forEach(wi),this.clearAllSnapshots();const a=K.now();W.delta=ct(0,1e3/60,a-W.timestamp),W.timestamp=a,W.isProcessing=!0,Fe.update.process(W),Fe.preRender.process(W),Fe.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ls.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ud),this.sharedNodes.forEach(yd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=z()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const u=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!zr(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||bt(this.latestValues)||c)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return o&&(u=this.removeTransform(u)),wd(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return z();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Sd))){const{scroll:l}=this.root;l&&(at(a.x,l.offset.x),at(a.y,l.offset.y))}return a}removeElementScroll(o){const a=z();if(et(a,o),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const l=this.path[u],{scroll:c,options:h}=l;l!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&et(a,o),at(a.x,c.offset.x),at(a.y,c.offset.y))}return a}applyTransform(o,a=!1,u){const l=u||z();et(l,o);for(let c=0;c<this.path.length;c++){const h=this.path[c];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(at(l.x,-h.scroll.offset.x),at(l.y,-h.scroll.offset.y)),bt(h.latestValues)&&me(l,h.latestValues,h.layout?.layoutBox)}return bt(this.latestValues)&&me(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=z();et(a,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];if(!bt(l.latestValues))continue;let c;l.instance&&(jn(l.latestValues)&&l.updateSnapshot(),c=z(),et(c,l.measurePageBox())),hi(a,l.latestValues,l.snapshot?.layoutBox,c)}return bt(this.latestValues)&&hi(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==W.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=W.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$h(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):et(this.target,this.layout.layoutBox),Er(this.target,this.targetDelta)):et(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||jn(this.parent.latestValues)||Ar(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),Ee(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),et(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===W.timestamp&&(u=!1),u)return;const{layout:l,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||c))return;et(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;vh(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=z());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oi(this.prevProjectionDelta.x,this.projectionDelta.x),oi(this.prevProjectionDelta.y,this.projectionDelta.y)),Ut(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!gi(this.projectionDelta.x,this.prevProjectionDelta.x)||!gi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Et(),this.projectionDelta=Et(),this.projectionDeltaWithTransform=Et()}setAnimationOrigin(o,a=!1,u){const l=this.snapshot,c=l?l.latestValues:{},h={...this.latestValues},f=Et();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=z(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,b=m!==g,x=this.getStack(),S=!x||x.members.length<=1,w=!!(b&&!S&&this.options.crossfade===!0&&!this.path.some(bd));this.animationProgress=0;let y;const k=u?.interpolateProjection(o);this.mixTargetDelta=P=>{const j=P/1e3,T=k?.(j);T?(f.x.translate=T.x,f.x.scale=D(o.x.scale,1,j),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=T.y,f.y.scale=D(o.y.scale,1,j),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Ti(f.x,o.x,j),Ti(f.y,o.y,j)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ee(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),vd(this.relativeTarget,this.relativeTargetOrigin,p,j),y&&Gh(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=z()),et(y,this.relativeTarget)),b&&(this.animationValues=h,qh(h,c,this.latestValues,j,w,S)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(mt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{ge.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Vt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jh(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(id),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:u,layout:l,latestValues:c}=o;if(!(!a||!u||!l)){if(this!==o&&this.layout&&l&&Hr(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||z();const h=G(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const f=G(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}et(a,u),me(a,c),Ut(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new sd),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const l={};u.z&&Ge("z",o,l,this.animationValues);for(let c=0;c<Ke.length;c++)Ge(`rotate${Ke[c]}`,o,l,this.animationValues),Ge(`skew${Ke[c]}`,o,l,this.animationValues);o.render();for(const c in l)o.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=pe(a?.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=pe(a?.pointerEvents)||""),this.hasProjected&&!bt(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=Yh(this.projectionDeltaWithTransform,this.treeScale,c);u&&(h=u(c,h)),o.transform=h;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=l===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in Rn){if(c[m]===void 0)continue;const{correct:g,applyTo:b,isCSSVariable:x}=Rn[m],S=h==="none"?c[m]:g(c[m],l);if(b){const w=b.length;for(let y=0;y<w;y++)o[b[y]]=S}else x?this.options.visualElement.renderState.vars[m]=S:o[m]=S}this.options.layoutId&&(o.pointerEvents=l===this?pe(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(xi),this.root.sharedNodes.clear()}}}function rd(t){t.updateLayout()}function ad(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=G(h);h.min=n[c].min,h.max=h.min+f});else if(i==="x"||i==="y"){const c=i==="x"?"y":"x";Dn(r?e.measuredBox[c]:e.layoutBox[c],n[c])}else Hr(i,e.layoutBox,n)&&rt(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=G(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const o=Et();Ut(o,n,e.layoutBox);const a=Et();r?Ut(a,t.applyTransform(s,!0),e.measuredBox):Ut(a,n,e.layoutBox);const u=!zr(o);let l=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const p=t.options.layoutAnchor||void 0,m=z();Ee(m,e.layoutBox,h.layoutBox,p);const g=z();Ee(g,n,f.layoutBox,p),Ur(m,g)||(l=!0),c.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function ld(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function cd(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ud(t){t.clearSnapshot()}function xi(t){t.clearMeasurements()}function hd(t){t.isLayoutDirty=!0,t.updateLayout()}function wi(t){t.isLayoutDirty=!1}function dd(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function fd(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Si(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function md(t){t.resolveTargetDelta()}function pd(t){t.calcProjection()}function gd(t){t.resetSkewAndRotation()}function yd(t){t.removeLeadSnapshot()}function Ti(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ci(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function vd(t,e,n,s){Ci(t.x,e.x,n.x,s),Ci(t.y,e.y,n.y,s)}function bd(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const xd={duration:.45,ease:[.4,0,.1,1]},Pi=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ki=Pi("applewebkit/")&&!Pi("chrome/")?Math.round:J;function Ai(t){t.min=ki(t.min),t.max=ki(t.max)}function wd(t){Ai(t.x),Ai(t.y)}function Hr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Wh(pi(e),pi(n),.2)}function Sd(t){return t!==t.root&&t.scroll?.wasRoot}const Td=_r({attachResizeListener:(t,e)=>Kt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ye={current:void 0},Kr=_r({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ye.current){const t=new Td({});t.mount(window),t.setOptions({layoutScroll:!0}),Ye.current=t}return Ye.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ps=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ei(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Cd(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Ei(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Ei(t[i],null)}}}}function Pd(...t){return v.useCallback(Cd(...t),t)}class kd extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(ce(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=ce(s)&&s.offsetWidth||0,r=ce(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Ad({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=v.useId(),a=v.useRef(null),u=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=v.useContext(ps),c=t.props?.ref??t?.ref,h=Pd(a,c);return v.useInsertionEffect(()=>{const{width:f,height:p,top:m,left:g,right:b,bottom:x,direction:S}=u.current;if(e||r===!1||!a.current||!f||!p)return;const w=S==="rtl",y=n==="left"?w?`right: ${b}`:`left: ${g}`:w?`left: ${g}`:`right: ${b}`,k=s==="bottom"?`bottom: ${x}`:`top: ${m}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");l&&(P.nonce=l);const j=i??document.head;return j.appendChild(P),P.sheet&&P.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${f}px !important;
|
|
5
|
+
height: ${p}px !important;
|
|
6
|
+
${y}px !important;
|
|
7
|
+
${k}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),j.contains(P)&&j.removeChild(P)}},[e]),d.jsx(kd,{isPresent:e,childRef:a,sizeRef:u,pop:r,children:r===!1?t:v.cloneElement(t,{ref:h})})}const Ed=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:u,root:l})=>{const c=$n(Md),h=v.useId(),f=v.useRef(n),p=v.useRef(s);_n(()=>{f.current=n,p.current=s});let m=!0,g=v.useMemo(()=>(m=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:b=>{c.set(b,!0);for(const x of c.values())if(!x)return;s&&s()},register:b=>(c.set(b,!1),()=>{c.delete(b),!f.current&&!c.size&&p.current?.()})}),[n,c,s]);return r&&m&&(g={...g}),v.useMemo(()=>{c.forEach((b,x)=>c.set(x,!1))},[n]),v.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),t=d.jsx(Ad,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:u,root:l,children:t}),d.jsx(Ve.Provider,{value:g,children:t})};function Md(){return new Map}function Gr(t=!0){const e=v.useContext(Ve);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=v.useId();v.useEffect(()=>{if(t)return i(r)},[t]);const o=v.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const ne=t=>t.key||"";function Mi(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const se=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:u="top",root:l})=>{const[c,h]=Gr(o),f=v.useMemo(()=>Mi(t),[t]),p=o&&!c?[]:f.map(ne),m=v.useRef(!0),g=v.useRef(f),b=$n(()=>new Map),x=v.useRef(new Set),[S,w]=v.useState(f),[y,k]=v.useState(f);_n(()=>{m.current=!1,g.current=f;for(let T=0;T<y.length;T++){const M=ne(y[T]);p.includes(M)?(b.delete(M),x.current.delete(M)):b.get(M)!==!0&&b.set(M,!1)}},[y,p.length,p.join("-")]);const P=[];if(f!==S){let T=[...f];for(let M=0;M<y.length;M++){const E=y[M],V=ne(E);p.includes(V)||(T.splice(M,0,E),P.push(E))}return r==="wait"&&P.length&&(T=P),k(Mi(T)),w(f),null}const{forceRender:j}=v.useContext(Wn);return d.jsx(d.Fragment,{children:y.map(T=>{const M=ne(T),E=o&&!c?!1:f===y||p.includes(M),V=()=>{if(x.current.has(M))return;if(b.has(M))x.current.add(M),b.set(M,!0);else return;let N=!0;b.forEach(X=>{X||(N=!1)}),N&&(j?.(),k(g.current),o&&h?.(),s&&s())};return d.jsx(Ed,{isPresent:E,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:E?void 0:V,anchorX:a,anchorY:u,children:T},M)})})},Yr=v.createContext({strict:!1}),ji={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Vi=!1;function jd(){if(Vi)return;const t={};for(const e in ji)t[e]={isEnabled:n=>ji[e].some(s=>!!n[s])};Cr(t),Vi=!0}function Xr(){return jd(),mh()}function Vd(t){const e=Xr();for(const n in t)e[n]={...e[n],...t[n]};Cr(e)}const Rd=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Me(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Rd.has(t)}let qr=t=>!Me(t);function Dd(t){typeof t=="function"&&(qr=e=>e.startsWith("on")?!Me(e):t(e))}try{Dd(require("@emotion/is-prop-valid").default)}catch{}function Ld(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||$(t[i])||(qr(i)||n===!0&&Me(i)||!e&&!Me(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Ne=v.createContext({});function Nd(t,e){if(Le(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ht(n)?n:void 0,animate:Ht(s)?s:void 0}}return t.inherit!==!1?e:{}}function Id(t){const{initial:e,animate:n}=Nd(t,v.useContext(Ne));return v.useMemo(()=>({initial:e,animate:n}),[Ri(e),Ri(n)])}function Ri(t){return Array.isArray(t)?t.join(" "):t}const gs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zr(t,e,n){for(const s in e)!$(e[s])&&!Vr(s,n)&&(t[s]=e[s])}function Od({transformTemplate:t},e){return v.useMemo(()=>{const n=gs();return fs(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Fd(t,e){const n=t.style||{},s={};return Zr(s,n,t),Object.assign(s,Od(t,e)),s}function Bd(t,e){const n={},s=Fd(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Qr=()=>({...gs(),attrs:{}});function zd(t,e,n,s){const i=v.useMemo(()=>{const r=Qr();return Rr(r,e,Lr(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Zr(r,t.style,t),i.style={...r,...i.style}}return i}const Ud=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ys(t){return typeof t!="string"||t.includes("-")?!1:!!(Ud.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wd(t,e,n,{latestValues:s},i,r=!1,o){const u=(o??ys(t)?zd:Bd)(e,s,i,t),l=Ld(e,typeof t=="string",r),c=t!==v.Fragment?{...l,...u,ref:n}:{},{children:h}=e,f=v.useMemo(()=>$(h)?h.get():h,[h]);return v.createElement(t,{...c,children:f})}function $d({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:_d(n,s,i,t),renderState:e()}}function _d(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=pe(r[f]);let{initial:o,animate:a}=t;const u=Le(t),l=Sr(t);e&&l&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!De(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const m=os(t,f[p]);if(m){const{transitionEnd:g,transition:b,...x}=m;for(const S in x){let w=x[S];if(Array.isArray(w)){const y=c?w.length-1:0;w=w[y]}w!==null&&(i[S]=w)}for(const S in g)i[S]=g[S]}}}return i}const Jr=t=>(e,n)=>{const s=v.useContext(Ne),i=v.useContext(Ve),r=()=>$d(t,e,s,i);return n?r():$n(r)},Hd=Jr({scrapeMotionValuesFromProps:ms,createRenderState:gs}),Kd=Jr({scrapeMotionValuesFromProps:Nr,createRenderState:Qr}),Gd=Symbol.for("motionComponentSymbol");function Yd(t,e,n){const s=v.useRef(n);v.useInsertionEffect(()=>{s.current=n});const i=v.useRef(null);return v.useCallback(r=>{r&&t.onMount?.(r),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const ta=v.createContext({});function Pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Xd(t,e,n,s,i,r){const{visualElement:o}=v.useContext(Ne),a=v.useContext(Yr),u=v.useContext(Ve),l=v.useContext(ps),c=l.reducedMotion,h=l.skipAnimations,f=v.useRef(null),p=v.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:r}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,g=v.useContext(ta);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&qd(f.current,n,i,g);const b=v.useRef(!1);v.useInsertionEffect(()=>{m&&b.current&&m.update(n,u)});const x=n[ur],S=v.useRef(!!x&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return _n(()=>{p.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),S.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!S.current&&m.animationState&&m.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),S.current=!1),m.enteringChildren=void 0)}),m}function qd(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:l,layoutAnchor:c,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ea(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Pt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:u,layoutRoot:l,layoutAnchor:c})}function ea(t){if(t)return t.options.allowProjection!==!1?t.projection:ea(t.parent)}function Xe(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Vd(s);const r=n?n==="svg":ys(t),o=r?Kd:Hd;function a(l,c){let h;const f={...v.useContext(ps),...l,layoutId:Zd(l)},{isStatic:p}=f,m=Id(l),g=o(l,p);if(!p&&typeof window<"u"){Qd();const b=Jd(f);h=b.MeasureLayout,m.visualElement=Xd(t,g,f,i,b.ProjectionNode,r)}return d.jsxs(Ne.Provider,{value:m,children:[h&&m.visualElement?d.jsx(h,{visualElement:m.visualElement,...f}):null,Wd(t,l,Yd(g,m.visualElement,c),g,p,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=v.forwardRef(a);return u[Gd]=t,u}function Zd({layoutId:t}){const e=v.useContext(Wn).id;return e&&t!==void 0?e+"-"+t:t}function Qd(t,e){v.useContext(Yr).strict}function Jd(t){const e=Xr(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function tf(t,e){if(typeof Proxy>"u")return Xe;const n=new Map,s=(r,o)=>Xe(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Xe(o,void 0,t,e)),n.get(o))})}const ef=(t,e)=>e.isSVG??ys(t)?new Vh(e):new Ph(e,{allowProjection:t!==v.Fragment});class nf extends gt{constructor(e){super(e),e.animationState||(e.animationState=Ih(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();De(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let sf=0;class of extends gt{constructor(){super(...arguments),this.id=sf++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"||typeof r=="object"&&r!==null&&!Array.isArray(r)){const a=Ct(this.node,r,o);if(a){const{transition:u,transitionEnd:l,...c}=a;for(const h in c)this.node.getValue(h)?.jump(c[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const rf={animation:{Feature:nf},exit:{Feature:of}};function Qt(t){return{point:{x:t.pageX,y:t.pageY}}}const af=t=>e=>cs(e)&&t(e,Qt(e));function Wt(t,e,n,s){return Kt(t,e,af(n),s)}const na=({current:t})=>t?t.ownerDocument.defaultView:null,Di=(t,e)=>Math.abs(t-e);function lf(t,e){const n=Di(t.x,e.x),s=Di(t.y,e.y);return Math.sqrt(n**2+s**2)}const Li=new Set(["auto","scroll"]);class sa{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ie(this.lastRawMoveEventInfo,this.transformPagePoint));const m=qe(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,b=lf(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!b)return;const{point:x}=m,{timestamp:S}=W;this.history.push({...x,timestamp:S});const{onStart:w,onMove:y}=this.handlers;g||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=ie(g,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:S}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qe(m.type==="pointercancel"?this.lastMoveEventInfo:ie(g,this.transformPagePoint),this.history);this.startEvent&&b&&b(m,w),x&&x(m,w)},!cs(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const u=Qt(e),l=ie(u,this.transformPagePoint),{point:c}=l,{timestamp:h}=W;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,qe(l,this.history));const p={passive:!0,capture:!0};this.removeListeners=Xt(Wt(this.contextWindow,"pointermove",this.handlePointerMove,p),Wt(this.contextWindow,"pointerup",this.handlePointerUp,p),Wt(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Li.has(s.overflowX)||Li.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),mt(this.updatePoint)}}function ie(t,e){return e?{point:e(t.point)}:t}function Ni(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qe({point:t},e){return{point:t,delta:Ni(t,ia(e)),offset:Ni(t,cf(e)),velocity:uf(e,.1)}}function cf(t){return t[0]}function ia(t){return t[t.length-1]}function uf(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=ia(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>q(e)*2&&(s=t[1]);const r=Q(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function hf(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Ii(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function df(t,{top:e,left:n,bottom:s,right:i}){return{x:Ii(t.x,n,i),y:Ii(t.y,e,s)}}function Oi(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function ff(t,e){return{x:Oi(t.x,e.x),y:Oi(t.y,e.y)}}function mf(t,e){let n=.5;const s=G(t),i=G(e);return i>s?n=$t(e.min,e.max-s,t.min):s>i&&(n=$t(t.min,t.max-i,e.min)),ct(0,1,n)}function pf(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ln=.35;function gf(t=Ln){return t===!1?t=0:t===!0&&(t=Ln),{x:Fi(t,"left","right"),y:Fi(t,"top","bottom")}}function Fi(t,e,n){return{min:Bi(t,e),max:Bi(t,n)}}function Bi(t,e){return typeof t=="number"?t:t[e]||0}const yf=new WeakMap;class vf{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Qt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_u(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rt(x=>{let S=this.getAxisMotionValue(x).get()||0;if(lt.test(S)){const{projection:w}=this.visualElement;if(w&&w.layout){const y=w.layout.layoutBox[x];y&&(S=G(y)*(parseFloat(S)/100))}}this.originPoint[x]=S}),g&&L.update(()=>g(h,f),!1,!0),Cn(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=f;if(m&&this.currentDirection===null){this.currentDirection=xf(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),b&&L.update(()=>b(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new sa(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:na(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&L.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!oe(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=hf(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=df(s.layoutBox,e):this.constraints=!1,this.elastic=gf(n),i!==this.constraints&&!Pt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&rt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=pf(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Pt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=bh(s,i.root,this.visualElement.getTransformPagePoint());let o=ff(i.layout.layoutBox,r);if(n){const a=n(gh(o));this.hasMutatedConstraints=!!a,a&&(o=kr(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},l=rt(c=>{if(!oe(c,n,this.currentDirection))return;let h=u&&u[c]||{};(o===!0||o===c)&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Cn(this.visualElement,e),s.start(is(e,s,0,n,this.visualElement,!1))}stopAnimation(){rt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){rt(n=>{const{drag:s}=this.getProps();if(!oe(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],u=r.get()||0;r.set(e[n]-D(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};rt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const u=a.get();i[o]=mf({min:u,max:u},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),rt(o=>{if(!oe(o,e,null))return;const a=this.getAxisMotionValue(o),{min:u,max:l}=this.constraints[o];a.set(D(u,l,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yf.set(this.visualElement,this);const e=this.visualElement.current,n=Wt(e,"pointerdown",l=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=l.target,p=f!==e&&qu(f);c&&h&&!p&&this.start(l)});let s;const i=()=>{const{dragConstraints:l}=this.getProps();Pt(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),s||(s=bf(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),L.read(i);const a=Kt(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(rt(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=l[h].translate,f.set(f.get()+l[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),u&&u(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Ln,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function zi(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function bf(t,e,n){const s=Gs(t,zi(n)),i=Gs(e,zi(n));return()=>{s(),i()}}function oe(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function xf(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class wf extends gt{constructor(e){super(e),this.removeGroupControls=J,this.removeListeners=J,this.controls=new vf(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||J}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ze=t=>(e,n)=>{t&&L.update(()=>t(e,n),!1,!0)};class Sf extends gt{constructor(){super(...arguments),this.removePointerDownListener=J}onPointerDown(e){this.session=new sa(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:na(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ze(e),onStart:Ze(n),onMove:Ze(s),onEnd:(r,o)=>{delete this.session,i&&L.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Wt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qe=!1;class Tf extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Qe&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ge.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Qe=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||L.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),ls.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Qe=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function oa(t){const[e,n]=Gr(),s=v.useContext(Wn);return d.jsx(Tf,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(ta),isPresent:e,safeToRemove:n})}const Cf={pan:{Feature:Sf},drag:{Feature:wf,ProjectionNode:Kr,MeasureLayout:oa}};function Ui(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&L.postRender(()=>r(e,Qt(e)))}class Pf extends gt{mount(){const{current:e}=this.node;e&&(this.unmount=Ku(e,(n,s)=>(Ui(this.node,s,"Start"),i=>Ui(this.node,i,"End"))))}unmount(){}}class kf extends gt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xt(Kt(this.node.current,"focus",()=>this.onFocus()),Kt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wi(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&L.postRender(()=>r(e,Qt(e)))}class Af extends gt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Qu(e,(i,r)=>(Wi(this.node,r,"Start"),(o,{success:a})=>Wi(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Nn=new WeakMap,Je=new WeakMap,Ef=t=>{const e=Nn.get(t.target);e&&e(t)},Mf=t=>{t.forEach(Ef)};function jf({root:t,...e}){const n=t||document;Je.has(n)||Je.set(n,{});const s=Je.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Mf,{root:t,...e})),s[i]}function Vf(t,e,n){const s=jf(e);return Nn.set(t,n),s.observe(t),()=>{Nn.delete(t),s.unobserve(t)}}const Rf={some:0,all:1};class Df extends gt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Rf[i]},a=u=>{const{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=l?c:h;f&&f(u)};this.stopObserver=Vf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Lf(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Lf({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Nf={inView:{Feature:Df},tap:{Feature:Af},focus:{Feature:kf},hover:{Feature:Pf}},If={layout:{ProjectionNode:Kr,MeasureLayout:oa}},Of={...rf,...Nf,...Cf,...If},re=tf(Of,ef),$i=t=>Symbol.iterator in t,_i=t=>"entries"in t,Hi=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Ff=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Bf(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:$i(t)&&$i(e)?_i(t)&&_i(e)?Hi(t,e):Ff(t,e):Hi({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function zf(t){const e=Ot.useRef(void 0);return n=>{const s=t(n);return Bf(e.current,s)?e.current:e.current=s}}const Ki=t=>{let e;const n=new Set,s=(l,c)=>{const h=typeof l=="function"?l(e):l;if(!Object.is(h,e)){const f=e;e=c??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(p=>p(e,f))}},i=()=>e,a={setState:s,getState:i,getInitialState:()=>u,subscribe:l=>(n.add(l),()=>n.delete(l))},u=e=t(s,i,a);return a},Uf=(t=>t?Ki(t):Ki),Wf=t=>t;function $f(t,e=Wf){const n=Ot.useSyncExternalStore(t.subscribe,Ot.useCallback(()=>e(t.getState()),[t,e]),Ot.useCallback(()=>e(t.getInitialState()),[t,e]));return Ot.useDebugValue(n),n}const Gi=t=>{const e=Uf(t),n=s=>$f(e,s);return Object.assign(n,e),n},_f=(t=>t?Gi(t):Gi);const ra=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();const Hf=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Kf=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase());const Yi=t=>{const e=Kf(t);return e.charAt(0).toUpperCase()+e.slice(1)};var tn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Gf=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Yf=v.createContext({}),Xf=()=>v.useContext(Yf),qf=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:s,className:i="",children:r,iconNode:o,...a},u)=>{const{size:l=24,strokeWidth:c=2,absoluteStrokeWidth:h=!1,color:f="currentColor",className:p=""}=Xf()??{},m=s??h?Number(n??c)*24/Number(e??l):n??c;return v.createElement("svg",{ref:u,...tn,width:e??l??tn.width,height:e??l??tn.height,stroke:t??f,strokeWidth:m,className:ra("lucide",p,i),...!r&&!Gf(a)&&{"aria-hidden":"true"},...a},[...o.map(([g,b])=>v.createElement(g,b)),...Array.isArray(r)?r:[r]])});const _=(t,e)=>{const n=v.forwardRef(({className:s,...i},r)=>v.createElement(qf,{ref:r,iconNode:e,className:ra(`lucide-${Hf(Yi(t))}`,`lucide-${t}`,s),...i}));return n.displayName=Yi(t),n};const Zf=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],In=_("arrow-left",Zf);const Qf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Xi=_("arrow-right",Qf);const Jf=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ye=_("check",Jf);const tm=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],On=_("chevron-down",tm);const em=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nm=_("chevron-right",em);const sm=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],qi=_("cloud",sm);const im=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],om=_("ellipsis",im);const rm=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],am=_("laptop",rm);const lm=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Zi=_("layout-grid",lm);const cm=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],um=_("monitor-smartphone",cm);const hm=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],dm=_("monitor",hm);const fm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],mm=_("panel-left",fm);const pm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],gm=_("panel-right",pm);const ym=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vm=_("search",ym);const bm=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Fn=_("smartphone",bm);const xm=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Qi=_("user-round",xm);const wm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vs=_("x",wm);function Sm(t,e){if(e.kind!=="unit")return null;const n=e.unitId.toLowerCase();return t.find(i=>i.id.toLowerCase()===n)?.name?.trim()||null}function aa(t,e){return(t.kind??"desktop")==="desktop"&&t.id!==e}function Tm(t,e,n,s={},i={},r=Date.now()){return t.filter(o=>aa(o,e)).map(o=>{const a=xa(o,s[o.id]??null,i[o.id],r);return{id:o.id,name:o.name,icon:o.icon??null,platform:o.platform??null,status:a.status,...a.refusal?{refusal:a.refusal}:{},capsReady:!!(o.online&&o.capsLive&&o.caps?.engine==="ready"),selected:n.kind==="unit"&&n.unitId===o.id}})}const Cm={strict:"unitm.reason.strict","never-prompts":"unitm.reason.neverPrompts","not-signed-in":"unitm.reason.notSignedIn","roster-miss":"unitm.reason.rosterMiss","roster-unreachable":"unitm.reason.rosterUnreachable","no-answer":"unitm.reason.noAnswer",busy:"unitm.reason.busy"};function Pm(t,e){const n=t.refusal?.reason;if(vo(n)&&(t.status==="callerBlocked"||t.status==="denied"||t.status==="awaitingConfirm"))return Cm[n];switch(t.status){case"checking":return e?"unitm.checking":t.capsReady?"unitm.ready":"unitm.unknown";case"ready":return"unitm.ready";case"starting":return"unitm.starting";case"engineStopped":return"unitm.engineOff";case"noEngine":return"unitm.noEngine";case"offline":return"unitm.offline";case"unreachable":return"unitm.unreachable";case"remoteOff":return"unitm.remoteOff";case"awaitingConfirm":return t.refusal?.state==="unconfirmed"?"unitm.confirmNotAsked":"unitm.confirmPending";case"denied":return"unitm.confirmDenied";case"callerBlocked":return"unitm.confirmDenied"}}const km={checking:"",ready:"ok",starting:"warn",engineStopped:"warn",noEngine:"err",offline:"",unreachable:"err",remoteOff:"warn",awaitingConfirm:"warn",denied:"err",callerBlocked:"err"};function Am(t,e){if(t.status==="checking")return!e&&t.capsReady?"ok":"";const n=t.refusal?.reason;return t.status==="callerBlocked"&&vo(n)&&Rl.has(n)?"warn":km[t.status]}const Ji={probes:{},sticky:{}};function Gt(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))return t;const n={...t};return delete n[e],n}function la(t){return Object.keys(t).filter(n=>t[n].state==="pending").reduce((n,s)=>Gt(n,s),t)}function Em(t,e){return{probes:Gt(t.probes,e),sticky:la(Gt(t.sticky,e))}}function Mm(t,e,n){return n.sticky?{probes:Gt(t.probes,e),sticky:{...t.sticky,[e]:n.sticky}}:n.probe?{probes:{...t.probes,[e]:n.probe},sticky:Gt(t.sticky,e)}:t}function to(t){const e=la(t.sticky);return e===t.sticky?t:{probes:t.probes,sticky:e}}async function jm(t){return t.current().kind==="unit"&&await t.select(go),t.forget()}function en(t){return Sa(t,{explicit:!0,name:Sm(ca,t)})}let ca=[];function eo(){return jl()}const Vm=t=>{const e=`${yo()}/units/${t}/open`,n=Y.getState().cfg.token;return n?`${e}#token=${encodeURIComponent(n)}`:e};pt({"unit.mobileNone":{zh:"名下还没有可连的设备:在电脑上登录同一 Forsion 账号,并开启「允许其他设备连接本机」",en:'No devices yet — sign in with this Forsion account on a computer and enable "Allow other devices to connect".'},"unit.mobileTunnel":{zh:"经云端中转打开(自动使用本机登录态)",en:"Opens via cloud relay (uses this device’s login automatically)"},"unitm.runOn":{zh:"在哪运行",en:"Run on"},"unitm.cloud":{zh:"Forsion 云端",en:"Forsion cloud"},"unitm.cloudDesc":{zh:"默认",en:"Default"},"unitm.current":{zh:"当前",en:"Current"},"unitm.checking":{zh:"正在连接…",en:"Connecting…"},"unitm.ready":{zh:"可用",en:"Available"},"unitm.unknown":{zh:"状态未知",en:"Status unknown"},"unitm.starting":{zh:"引擎正在启动",en:"Engine is starting"},"unitm.engineOff":{zh:"电脑在线,但 Forsion 引擎没有运行",en:"Online, but the Forsion engine isn't running"},"unitm.noEngine":{zh:"这台电脑上的 Forsion 没有 Agent 引擎",en:"Forsion on this computer has no agent engine"},"unitm.offline":{zh:"离线",en:"Offline"},"unitm.unreachable":{zh:"暂时连不上,稍后重试",en:"Can't reach it right now. Try again shortly"},"unitm.confirmPending":{zh:"请在「{name}」上允许这台手机",en:'Allow this phone on "{name}"'},"unitm.confirmDenied":{zh:"「{name}」拒绝了这台手机,10 分钟后可以再次请求",en:'"{name}" declined this phone. You can ask again in 10 minutes'},"unitm.confirmNotAsked":{zh:"「{name}」还没有允许这台手机,点按再次请求",en:`"{name}" hasn't allowed this phone yet. Tap to ask again`},"unitm.reason.strict":{zh:"「{name}」只允许这类连接查看,不会再询问;请在那台电脑的「设置 › 远程会话」中允许",en:`"{name}" only lets connections like this one view sessions and won't ask again. Allow it in Settings › Remote sessions there`},"unitm.reason.neverPrompts":{zh:"「{name}」不会为这类连接弹框询问;请在那台电脑的「设置 › 远程会话」中允许",en:`"{name}" doesn't ask for connections like this one. Allow it in Settings › Remote sessions there`},"unitm.reason.notSignedIn":{zh:"「{name}」没有登录 Forsion,请先在那台电脑上登录",en:`"{name}" isn't signed in to Forsion. Sign in there first`},"unitm.reason.rosterMiss":{zh:"「{name}」的账号里找不到这台手机,请确认两台设备登录的是同一个账号",en:`"{name}" can't find this phone in its account. Make sure both devices use the same account`},"unitm.reason.rosterUnreachable":{zh:"「{name}」暂时无法核对这台手机,请稍后再试",en:`"{name}" can't check this phone right now. Try again shortly`},"unitm.reason.noAnswer":{zh:"「{name}」上没有人回应确认,请稍后再试",en:'No one answered on "{name}". Try again in a minute'},"unitm.reason.busy":{zh:"「{name}」上待确认的请求太多,请稍后再试",en:'"{name}" has too many requests waiting. Try again shortly'},"unitm.remoteOff":{zh:"请在「{name}」上开启「允许远程会话」",en:'Turn on "Allow remote sessions" on "{name}"'},"unitm.callerUnavailable":{zh:"这台手机暂时无法证明自己的身份,请稍后重试",en:"This phone couldn't verify its identity. Try again later"},"unitm.callerUnsupported":{zh:"服务器版本过旧,暂不支持从手机运行",en:"The server is too old to run from a phone"},"unitm.network":{zh:"暂时连不上 Forsion,请检查网络后重试",en:"Can't reach Forsion right now. Check your connection and try again"},"unitm.signedOut":{zh:"登录已失效,请重新登录后再试",en:"Your sign-in has expired. Sign in again and retry"},"unitm.nativeOnly":{zh:"仅在 Forsion 安卓 App 中可用",en:"Only available in the Forsion Android app"},"unitm.vault":{zh:"智库",en:"Vault"},"unitm.vaultLocalDesc":{zh:"笔记存在这台手机上",en:"Notes are stored on this phone"},"unitm.vaultCloudDesc":{zh:"笔记存在云端,各设备都能打开",en:"Notes are stored in the cloud for all your devices"},"unitm.openScreen":{zh:"打开设备界面",en:"Open device screen"},"unitm.thisPhone":{zh:"本机",en:"This phone"},"unitm.registeredAs":{zh:"已登记为「{name}」",en:'Registered as "{name}"'},"unitm.notRegistered":{zh:"尚未登记(首次在电脑上运行时自动登记)",en:"Not registered yet (happens the first time you run on a computer)"},"unitm.forget":{zh:"移除本机登记",en:"Remove this phone"},"unitm.forgetConfirm":{zh:"移除后,各电脑对这台手机的授权都会失效",en:"Computers will stop trusting this phone after removal"},"unitm.forgetDo":{zh:"移除",en:"Remove"}});const Yt=_f(t=>({open:!1,setOpen:e=>t({open:e})}));function Rm(){window.tangu?.unitsList&&(wa(()=>Yt.getState().setOpen(!0)),gl({id:"rb-units-mobile",side:"bottom",mobileFoot:!0,icon:um,tooltip:()=>Y.getState().tr("unit.switcher"),onClick:()=>Yt.getState().setOpen(!0)}))}const no=t=>{(async()=>{for(const e of[window.tangu?.openUnitPage,window.tangu?.openExternal])if(e)try{await e(t);return}catch{}window.open(t,"_blank","noopener")})()},so=t=>t.endsWith("/")?t:`${t}/`,io=t=>t.icon?d.jsx("span",{style:{fontSize:18},"aria-hidden":!0,children:t.icon}):t.platform==="android"||t.platform==="ios"?d.jsx(Fn,{size:18}):t.platform==="win32"||t.platform==="linux"?d.jsx(dm,{size:18}):d.jsx(am,{size:18}),Dm=()=>window.amadeusVaultMode,Lm={nativeOnly:"unitm.nativeOnly",callerUnavailable:"unitm.callerUnavailable",callerUnsupported:"unitm.callerUnsupported",network:"unitm.network",signedOut:"unitm.signedOut"};function Nm(){const{t}=fo(),e=Yt(C=>C.open),n=Yt(C=>C.setOpen),[s,i]=v.useState(void 0),[r,o]=v.useState(null),[a,u]=v.useState(Ji),[l,c]=v.useState(null),[h,f]=v.useState(null),[p,m]=v.useState(!1),[g,b]=v.useState(!1),[x,S]=v.useState(!1),[w,y]=v.useState(""),k=v.useRef(null),P=yl(C=>C.vaultSide),[j,T]=v.useState(!1),M=()=>{(window.tangu?.unitSelf?.()??Promise.resolve(null)).then(C=>{o(C),C?.relay==="native_only"?f("nativeOnly"):C?.relay==="unsupported"&&f("callerUnsupported")}).catch(()=>o(null))};v.useEffect(()=>{if(e)return i(void 0),f(null),S(!1),window.tangu?.unitsList?.().then(C=>{const I=C?.status===200?C.json?.units??[]:C?.status===401?null:[];I&&(ca=I),i(I)}).catch(()=>i([])),M(),()=>{k.current?.abort(),k.current=null,c(null),u(to)}},[e]),v.useEffect(()=>{if(!e)return;const C=I=>{I.preventDefault(),I.detail?.probe||n(!1)};return window.addEventListener("forsion:mobile-back",C),()=>window.removeEventListener("forsion:mobile-back",C)},[e,n]);const[,E]=v.useState(0);if(v.useEffect(()=>Ml(()=>E(C=>C+1)),[]),!e)return null;const V=eo(),N=Tm(s||[],r?.unitId??null,V,a.probes,a.sticky),X=(s||[]).filter(C=>aa(C,r?.unitId??null)),H=C=>{k.current?.abort();const I=new AbortController;k.current=I,c(C.id),f(null),u(R=>Em(R,C.id));const Nt=R=>{I.signal.aborted||u(ht=>Mm(ht,C.id,R))};Ta(yo(),C.id,{ensureSelf:async()=>{const R=await(window.tangu?.unitEnsureSelf?.()??Promise.resolve({ok:!1,code:"native_only"}));return R.ok&&!I.signal.aborted&&M(),R},fetchJson:async(R,ht)=>{const xs=await fetch(R,ht);let ws=null;try{ws=await xs.json()}catch{}return{status:xs.status,json:ws}},select:en,sleep:R=>new Promise(ht=>setTimeout(ht,R)),now:()=>Date.now(),progress:Nt},I.signal).then(R=>{I.signal.aborted||R.kind==="cancelled"||(R.kind==="selected"?(Ss(C.id,{ok:!0}),Ya(C.id)):R.kind==="device"&&(R.probe&&Ss(C.id,R.probe),R.sticky&&Xa(C.id,R.sticky)),R.kind==="phone"?f(R.issue):R.kind==="device"&&Nt(R),M())}).finally(()=>{k.current===I&&(k.current=null,c(null))})},tt=()=>{k.current?.abort(),k.current=null,c(null),u(to),en(go)},Z=()=>{S(!1),k.current?.abort(),k.current=null,c(null),jm({current:eo,select:en,forget:()=>window.tangu?.unitForgetSelf?.()??Promise.resolve({ok:!1})}).catch(()=>({ok:!1})).then(()=>{u(Ji),M()})},Ie=()=>{const C=w.trim();C&&no(so(/^https?:\/\//i.test(C)?C:`http://${C}`))},F=V.kind==="home",U=C=>C.status==="offline"&&!C.selected,it=C=>{const I=l===C.id,Nt=C.status==="offline";return d.jsxs("button",{className:"mb-sheet-row us-row","data-run-row":C.id,"data-status":C.status,"data-reason":C.refusal?.reason,"aria-pressed":C.selected,"aria-disabled":Nt||void 0,"aria-busy":I||void 0,onClick:()=>H(C),children:[d.jsx("span",{className:"us-row-icon",children:io(C)}),d.jsxs("span",{className:"us-row-main",children:[d.jsx("span",{className:"us-row-title",children:d.jsx("span",{className:"us-row-name",children:C.name})}),d.jsxs("span",{className:"us-row-sub",role:"status",children:[d.jsx("i",{className:`settings-status-dot ${Am(C,I)}`,"aria-hidden":!0}),d.jsx("span",{children:t(Pm(C,I),{name:C.name})})]})]}),d.jsx("span",{className:"us-row-end",children:C.selected?d.jsxs(d.Fragment,{children:[d.jsx("em",{className:"us-pill",children:t("unitm.current")}),d.jsx(ye,{size:16})]}):d.jsx(Xi,{size:15})})]},C.id)},ot=Dm(),Oe=C=>{!ot||j||C===P||(T(!0),Promise.resolve().then(()=>ot.switch(C)).catch(I=>Y.getState().toast(String(I?.message||I),!0)).finally(()=>T(!1)))};return d.jsx("div",{className:"mb-sheet-scrim us-scrim",onClick:()=>n(!1),"data-units-sheet":!0,children:d.jsxs("div",{className:"mb-sheet us-sheet",onClick:C=>C.stopPropagation(),children:[d.jsx("div",{className:"mb-sheet-grip"}),d.jsxs("div",{className:"us-head",children:[d.jsx("span",{className:"us-head-title",children:t("unit.switcher")}),d.jsx("button",{className:"us-icon-btn","aria-label":t("common.close"),onClick:()=>n(!1),children:d.jsx(vs,{size:18})})]}),d.jsxs("div",{className:"us-body",children:[ot&&d.jsxs("section",{className:"us-section","data-vault-side":P,children:[d.jsx("div",{className:"us-section-title",children:t("unitm.vault")}),["local","cloud"].map(C=>d.jsxs("button",{className:"mb-sheet-row us-row","data-vault-row":C,"aria-pressed":P===C,"aria-busy":j||void 0,onClick:()=>Oe(C),children:[d.jsx("span",{className:"us-row-icon",children:C==="local"?d.jsx(Fn,{size:18}):d.jsx(qi,{size:18})}),d.jsxs("span",{className:"us-row-main",children:[d.jsx("span",{className:"us-row-title",children:d.jsx("span",{className:"us-row-name",children:t(C==="local"?"notes.cloud.local":"notes.cloud.cloud")})}),d.jsx("span",{className:"us-row-sub",children:t(C==="local"?"unitm.vaultLocalDesc":"unitm.vaultCloudDesc")})]}),d.jsx("span",{className:"us-row-end",children:P===C&&d.jsxs(d.Fragment,{children:[d.jsx("em",{className:"us-pill",children:t("unitm.current")}),d.jsx(ye,{size:16})]})})]},C))]}),d.jsxs("section",{className:"us-section","data-run-on":!0,children:[d.jsx("div",{className:"us-section-title",children:t("unitm.runOn")}),h&&d.jsx("div",{className:"us-banner",role:"status","data-phone-issue":h,children:t(Lm[h])}),d.jsxs("button",{className:"mb-sheet-row us-row","data-run-row":"home","aria-pressed":F,onClick:tt,children:[d.jsx("span",{className:"us-row-icon",children:d.jsx(qi,{size:18})}),d.jsxs("span",{className:"us-row-main",children:[d.jsx("span",{className:"us-row-title",children:d.jsx("span",{className:"us-row-name",children:t("unitm.cloud")})}),d.jsx("span",{className:"us-row-sub",children:t("unitm.cloudDesc")})]}),d.jsx("span",{className:"us-row-end",children:F&&d.jsxs(d.Fragment,{children:[d.jsx("em",{className:"us-pill",children:t("unitm.current")}),d.jsx(ye,{size:16})]})})]}),s===void 0&&d.jsx("div",{className:"us-empty",children:"…"}),s===null&&d.jsx("div",{className:"us-empty",children:t("unit.notLoggedIn")}),s&&N.length===0&&d.jsx("div",{className:"us-empty",children:t("unit.mobileNone")}),N.filter(C=>!U(C)).map(it),N.some(U)&&d.jsxs("button",{className:"us-section-title us-section-toggle","aria-expanded":g,"data-offline-fold":!0,onClick:()=>b(C=>!C),children:[d.jsxs("span",{style:{flex:1},children:[t("unit.offlineGroup")," · ",N.filter(U).length]}),d.jsx(On,{size:14})]}),g&&N.filter(U).map(it)]}),d.jsxs("section",{className:"us-section","data-open-screen":!0,children:[d.jsxs("button",{className:"us-section-title us-section-toggle","aria-expanded":p,onClick:()=>m(C=>!C),children:[d.jsx("span",{style:{flex:1},children:t("unitm.openScreen")}),d.jsx(On,{size:14})]}),p&&d.jsxs(d.Fragment,{children:[X.flatMap(C=>{const I=C.lanUrl;return(I?["lan","tunnel"]:["tunnel"]).map(R=>{const ht=R==="tunnel"&&!C.online;return d.jsxs("button",{className:"mb-sheet-row us-row","aria-disabled":ht||void 0,onClick:()=>no(R==="lan"?so(I):Vm(C.id)),children:[d.jsx("span",{className:"us-row-icon",children:io(C)}),d.jsxs("span",{className:"us-row-main",children:[d.jsxs("span",{className:"us-row-title",children:[d.jsx("span",{className:"us-row-name",children:C.name}),d.jsx("em",{className:"us-pill muted",children:t(R==="lan"?"unit.viaLan":"unit.viaTunnel")}),ht&&d.jsx("em",{className:"us-pill muted",children:t("unit.offline")})]}),d.jsx("span",{className:"us-row-sub",children:t(R==="lan"?"unit.deviceLanDesc":"unit.mobileTunnel")})]}),d.jsx("span",{className:"us-row-end",children:d.jsx(Xi,{size:15})})]},`${C.id}:${R}`)})}),d.jsxs("div",{className:"us-addr",children:[d.jsx("div",{className:"us-addr-desc",children:t("unit.byAddressDesc")}),d.jsxs("div",{className:"us-addr-row",children:[d.jsx("input",{value:w,onChange:C=>y(C.target.value),onKeyDown:C=>{C.key==="Enter"&&Ie()},placeholder:"http://<ip>:<port>",inputMode:"url"}),d.jsx("button",{className:"us-btn",onClick:Ie,children:t("unit.byAddress")})]})]})]})]}),d.jsxs("section",{className:"us-section","data-this-phone":!0,children:[d.jsx("div",{className:"us-section-title",children:t("unitm.thisPhone")}),d.jsxs("div",{className:"us-self",children:[d.jsx("span",{className:"us-row-icon",children:d.jsx(Fn,{size:18})}),d.jsx("span",{className:"us-self-text",children:r?.relay==="native_only"?t("unitm.nativeOnly"):r?.registered?t("unitm.registeredAs",{name:r.name||""}):t("unitm.notRegistered")}),r?.registered&&!x&&d.jsx("button",{className:"us-btn danger",onClick:()=>S(!0),children:t("unitm.forget")})]}),x&&d.jsxs("div",{className:"us-confirm",role:"alertdialog",children:[d.jsx("span",{children:t("unitm.forgetConfirm")}),d.jsxs("span",{className:"us-confirm-actions",children:[d.jsx("button",{className:"us-btn",onClick:()=>S(!1),children:t("common.cancel")}),d.jsx("button",{className:"us-btn danger",onClick:Z,children:t("unitm.forgetDo")})]})]})]})]})]})})}const oo={isNativePlatform:()=>!1,getPlatform:()=>"web",isPluginAvailable:t=>!1,convertFileSrc:t=>t};function Jt(t){const e=async()=>{throw new Error(`Capacitor plugin "${t}" 在浏览器里不可用`)};return new Proxy({},{get:()=>e})}pt({"mobile.back.exitHint":{zh:"再返回一次退出",en:"Go back again to exit"}});function Im(t){return()=>{}}function Om(){return!1}pt({"nativebar.badge.running":{zh:"有会话在运行",en:"A session is running"},"nativebar.badge.attention":{zh:"有会话等你处理",en:"A session is waiting for you"},"nativebar.badge.unread":{zh:"有未读",en:"Unread"}});function Fm(){const t=Y.getState(),e={},n=an.getState().dm,s=r=>t.sessions.some(o=>!!n[o.id]?.[r]);return qa(Za(an.getState().byTarget),t.messagesBySession,t.runningBySession).size>0||s("awaiting")?e.tangu="attention":Object.keys(t.runningBySession).length?e.tangu="running":(t.unread.size&&t.sessions.some(r=>t.unread.has(r.id))||s("unread"))&&(e.tangu="unread"),ve.getState().unreadCount>0&&(e.inbox="unread"),e}let St=null;const Bn=new Set,ua=t=>(Bn.add(t),()=>{Bn.delete(t)}),Bm=ua,ro=()=>{Bn.forEach(t=>t())};function zm(){vl((t,e)=>new Promise(n=>{if(e.aborted){n(null);return}St?.finish(null);const s=()=>i.finish(null),i={payload:t,finish(r){e.removeEventListener("abort",s),St===i&&(St=null,ro()),n(r)}};St=i,e.addEventListener("abort",s,{once:!0}),ro()})),Bl({titleOf:t=>t.closest(".settings-setting-row")?.querySelector(".settings-control-copy strong")?.textContent})}function nn({icon:t}){return t?t.kind==="text"?d.jsx("span",{className:"bmc-sheet-icon","aria-hidden":"true",children:t.text}):d.jsx("svg",{className:"bmc-sheet-icon",viewBox:t.viewBox.join(" "),strokeWidth:t.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.paths.map((e,n)=>d.jsx("path",{d:e.d,fill:e.fill?"currentColor":"none",stroke:e.stroke?"currentColor":"none"},n))}):d.jsx("span",{className:"bmc-sheet-icon"})}function Um({request:t}){const{t:e}=fo(),{payload:n}=t,s=v.useRef(null),i=v.useRef(null),[r,o]=v.useState(n.kind==="menu"?[n]:[]),[a,u]=v.useState(""),[l,c]=v.useState(n.kind==="checklist"?n.checked:[]),h=v.useRef(l);h.current=l;const[f,p]=v.useState(n.kind==="prompt"?n.initial??"":""),m=r[r.length-1],g=()=>t.finish(n.kind==="checklist"?{checked:h.current}:null),b=()=>{r.length>1?(o(y=>y.slice(0,-1)),u("")):g()},x=v.useRef(b);x.current=b,v.useLayoutEffect(()=>{const y=document.activeElement;s.current?.showModal(),n.kind==="prompt"&&(i.current?.focus(),i.current?.select());const k=P=>{P.preventDefault(),P.stopImmediatePropagation(),P.detail?.probe||x.current()};return window.addEventListener("forsion:mobile-back",k,!0),()=>{window.removeEventListener("forsion:mobile-back",k,!0),s.current?.close(),!St&&y?.isConnected&&y.focus({preventScroll:!0})}},[]);const S=m?.sections.map(y=>({...y,items:y.items.filter(k=>!a||`${k.label} ${k.detail??""}`.toLocaleLowerCase().includes(a.toLocaleLowerCase()))})),w=m?.title??n.title;return d.jsx("dialog",{ref:s,className:"bmc-sheet-dialog","aria-label":w??e("common.close"),onCancel:y=>{y.preventDefault(),b()},onPointerDown:y=>y.stopPropagation(),onMouseDown:y=>y.stopPropagation(),onClick:y=>{y.stopPropagation(),y.target===y.currentTarget&&g()},children:d.jsxs("section",{className:"bmc-sheet","data-browser-mobile-sheet":n.kind,children:[d.jsx("div",{className:"mb-sheet-grip"}),d.jsxs("header",{className:"bmc-sheet-head",children:[r.length>1&&d.jsx("button",{className:"bmc-button","aria-label":n.kind==="menu"?n.back??e("common.back"):e("common.back"),onClick:b,children:d.jsx(In,{size:20})}),d.jsx("strong",{children:w}),d.jsx("button",{className:"bmc-button","aria-label":e("common.close"),onClick:g,children:d.jsx(vs,{size:20})})]}),m?.search&&d.jsx("input",{className:"bmc-sheet-search","aria-label":m.search.placeholder,placeholder:m.search.placeholder,value:a,onChange:y=>u(y.target.value)}),d.jsxs("div",{className:"bmc-sheet-body",children:[S?.map((y,k)=>d.jsxs("div",{className:"bmc-sheet-section",children:[y.title&&d.jsx("div",{className:"bmc-sheet-section-title",children:y.title}),d.jsx("div",{className:y.grid?"bmc-sheet-grid":void 0,children:y.items.map(P=>d.jsxs("div",{className:"bmc-sheet-item",children:[d.jsxs("button",{className:"bmc-sheet-row","data-sheet-item":P.id,disabled:P.disabled,"data-danger":P.danger||void 0,"aria-pressed":P.checked??void 0,onClick:()=>{P.children?.length?(o(j=>[...j,{title:P.label,sections:P.children,search:P.search}]),u("")):t.finish({id:P.id})},children:[d.jsx(nn,{icon:P.icon}),d.jsxs("span",{className:"bmc-sheet-copy",children:[P.label,P.detail&&d.jsx("small",{children:P.detail})]}),P.children?.length?d.jsx(nm,{size:18}):P.checked?d.jsx(ye,{size:18}):null]}),P.trailing&&d.jsx("button",{className:"bmc-button","aria-label":P.trailing.label,disabled:P.disabled,onClick:()=>t.finish({id:P.id,trailing:!0}),children:d.jsx(nn,{icon:P.trailing.icon})})]},P.id))}),y.footer&&d.jsx("p",{className:"bmc-sheet-note",children:y.footer})]},k)),m?.search&&!S?.some(y=>y.items.length)&&d.jsx("p",{className:"bmc-sheet-note",children:m.search.empty}),n.kind==="checklist"&&d.jsxs(d.Fragment,{children:[n.items.map(y=>d.jsxs("label",{className:"bmc-sheet-row","data-sheet-item":y.id,children:[d.jsx(nn,{icon:y.icon}),d.jsxs("span",{className:"bmc-sheet-copy",children:[y.label,y.detail&&d.jsx("small",{children:y.detail})]}),d.jsx("input",{type:"checkbox",checked:l.includes(y.id),disabled:y.disabled||!l.includes(y.id)&&l.length>=n.max||l.includes(y.id)&&l.length<=(n.min??0),onChange:k=>c(P=>k.target.checked?[...P,y.id]:P.filter(j=>j!==y.id))})]},y.id)),n.footer&&d.jsx("p",{className:"bmc-sheet-note",children:n.footer}),d.jsx("button",{className:"bmc-sheet-submit",onClick:g,children:n.done})]}),n.kind==="prompt"&&d.jsxs("form",{onSubmit:y=>{y.preventDefault(),t.finish({text:f})},children:[n.label&&d.jsx("label",{htmlFor:"bmc-prompt",children:n.label}),d.jsx("input",{ref:i,id:"bmc-prompt","aria-label":n.label??n.title,maxLength:1e5,placeholder:n.placeholder,value:f,onChange:y=>p(y.target.value)}),d.jsxs("div",{className:"bmc-sheet-buttons",children:[d.jsx("button",{type:"button",onClick:g,children:n.cancel}),d.jsx("button",{className:"bmc-sheet-submit",type:"submit",children:n.confirm})]})]}),n.kind==="confirm"&&d.jsxs(d.Fragment,{children:[n.message&&d.jsx("p",{children:n.message}),d.jsxs("div",{className:"bmc-sheet-buttons",children:[d.jsx("button",{onClick:g,children:n.cancel}),d.jsx("button",{className:"bmc-sheet-submit","data-danger":n.danger||void 0,onClick:()=>t.finish({ok:!0}),children:n.confirm})]})]})]})]})})}function Wm(){const t=v.useSyncExternalStore(ua,()=>St);return v.useLayoutEffect(()=>()=>{St?.finish(null)},[]),t?d.jsx(Um,{request:t},_m(t)):null}const sn=new WeakMap;let $m=0;function _m(t){return sn.has(t)||sn.set(t,++$m),sn.get(t)}let ha={mode:"hidden"},zn=!1,on=!1;const Un=new Set,Hm=t=>(Un.add(t),()=>{Un.delete(t)});function bs(){return zn}function Km(){zn||(zn=!0,zm(),bl({spaces:!0,render(t){ha=t,!on&&(on=!0,queueMicrotask(()=>{on=!1,Un.forEach(e=>e())}))}}))}const Gm=t=>{const e=[Y.subscribe(t),an.subscribe(t),ve.subscribe(t)];return()=>{e.forEach(n=>n())}},Ym=()=>JSON.stringify(Fm());function Xm(t,e){const n=`[data-nc-caps]{--nc-capl-w:${Math.max(0,Math.round(t))};--nc-capr-w:${Math.max(0,Math.round(e))}}`;let s=document.getElementById("nc-caps");s||(s=document.createElement("style"),s.id="nc-caps",document.head.appendChild(s)),s.textContent!==n&&(s.textContent=n)}function vt({action:t,label:e,children:n}){return d.jsx("button",{className:"bmc-button","data-chrome-action":t,"aria-label":e,onClick:()=>ae(t),children:n})}function ao({sp:t,badge:e}){const n=je(s=>s.spaces.find(i=>i.id===t.id)?.icon);return d.jsxs("button",{className:"bmc-destination","data-space":t.id,"aria-current":t.active?"page":void 0,onClick:()=>Sl(t.id),children:[d.jsxs("span",{className:"bmc-destination-icon",children:[n&&d.jsx(n,{size:22}),e&&d.jsx("i",{className:"bmc-badge","data-kind":e,"aria-label":Y.getState().tr(`nativebar.badge.${e}`)})]}),d.jsx("span",{children:t.label})]})}const qm=58,lo=4;function Zm(){const t=v.useSyncExternalStore(Hm,()=>ha),e=v.useSyncExternalStore(Ca,Pa),n=JSON.parse(v.useSyncExternalStore(Gm,Ym)),s=v.useRef(null),i=v.useRef(null),r=v.useRef(null),o=v.useRef(null),a=v.useRef(null),u=t.mode==="shell"?t.spaces??[]:[],l=u.filter(T=>T.pinned),c=u.length>1,h=xl(),f=h&&c,p=!h&&c,m=u.some(T=>!T.pinned),g=t.mode==="shell"&&t.leftBack,[b,x]=v.useState(Number.MAX_SAFE_INTEGER),S=wl(u,b),w=t.mode==="shell"?t.leftInset??0:0,y=t.mode==="shell"?t.capLeftMax??0:0;v.useLayoutEffect(()=>{const T=()=>{const E=t.mode!=="hidden"?s.current?.getBoundingClientRect().bottom??0:0,V=p?window.innerHeight-(i.current?.getBoundingClientRect().top??window.innerHeight):0;for(const[N,X]of[["--nc-top",E],["--nc-bottom",V]]){const H=String(Math.max(0,Math.round(X)));document.body.style.getPropertyValue(N)!==H&&document.body.style.setProperty(N,H)}Xm(r.current?.getBoundingClientRect().width??0,o.current?.getBoundingClientRect().width??0)};T();const M=new ResizeObserver(T);return s.current&&M.observe(s.current),i.current&&M.observe(i.current),r.current&&M.observe(r.current),o.current&&M.observe(o.current),window.addEventListener("resize",T),window.addEventListener(Cs,T),window.visualViewport?.addEventListener("resize",T),()=>{M.disconnect(),window.removeEventListener("resize",T),window.removeEventListener(Cs,T),window.visualViewport?.removeEventListener("resize",T)}},[t.mode,p,g,w,f]),v.useLayoutEffect(()=>{document.documentElement.toggleAttribute("data-browser-rail",f);const T=a.current;if(!f||!T)return;const M=()=>x(Math.max(0,Math.floor((T.clientHeight+lo)/(qm+lo))));M();const E=new ResizeObserver(M);return E.observe(T),()=>E.disconnect()},[f]),v.useLayoutEffect(()=>()=>{document.body.style.removeProperty("--nc-top"),document.body.style.removeProperty("--nc-bottom"),document.getElementById("nc-caps")?.remove(),document.documentElement.removeAttribute("data-browser-rail")},[]);const P=w||f?{left:`calc(${[f?"var(--bmc-rail-w) + env(safe-area-inset-left) / var(--uiz, 1)":"",w?`${w}px / var(--uiz, 1)`:""].filter(Boolean).join(" + ")})`}:void 0,j=y?{maxWidth:`min(65%, calc(${y}px / var(--uiz, 1)))`}:void 0;return d.jsxs(d.Fragment,{children:[t.mode!=="hidden"&&d.jsxs("div",{className:"bmc-chrome","data-browser-mobile-chrome":!0,"data-mode":t.mode,children:[d.jsxs("header",{className:"bmc-top",ref:s,style:P,children:[d.jsxs("div",{className:"bmc-capsule bmc-heading",ref:r,style:j,children:[t.mode==="page"?d.jsx(vt,{action:"back",label:t.back,children:d.jsx(In,{size:20})}):t.left&&d.jsx(vt,{action:"left",label:t.labels.left,children:t.leftBack?d.jsx(In,{size:20}):d.jsx(mm,{size:20})}),t.mode==="shell"&&t.titleTap?d.jsxs("button",{className:"bmc-title","data-chrome-action":"title",onClick:()=>ae("title"),children:[d.jsx("span",{children:t.title}),t.titleSub&&d.jsx("small",{children:t.titleSub}),d.jsx(On,{size:14})]}):d.jsxs("div",{className:"bmc-title",children:[d.jsx("span",{children:t.title}),t.mode==="shell"&&t.titleSub&&d.jsx("small",{children:t.titleSub})]})]}),d.jsx("div",{className:"bmc-capsule bmc-actions",ref:o,children:t.mode==="page"?t.close&&d.jsx(vt,{action:"close",label:t.close,children:d.jsx(vs,{size:20})}):d.jsxs(d.Fragment,{children:[t.search&&d.jsx(vt,{action:"search",label:t.search,children:d.jsx(vm,{size:20})}),t.right&&d.jsx(vt,{action:"right",label:t.labels.right,children:d.jsx(gm,{size:20})}),t.tabCount>1&&d.jsx(vt,{action:"tabs",label:t.labels.tabs,children:d.jsx("span",{className:"mb-tabcount",children:t.tabCount})}),d.jsx(vt,{action:"more",label:t.labels.more,children:d.jsx(om,{size:20})}),!g&&!f&&e&&d.jsx("button",{className:"bmc-button bmc-account","aria-label":e.label,"data-chrome-action":"account",onClick:()=>e.activate(),children:e.avatar?d.jsx("img",{src:e.avatar,alt:""}):e.loggedIn?e.initial:d.jsx(Qi,{size:20})})]})})]}),p&&t.mode==="shell"&&d.jsxs("nav",{ref:i,className:"bmc-dock","aria-label":t.allLabel,children:[l.map(T=>d.jsx(ao,{sp:T,badge:n[T.id]},T.id)),m&&d.jsxs("button",{className:"bmc-destination","data-chrome-action":"spacesAll",onClick:()=>ae("spacesAll"),children:[d.jsx(Zi,{size:22}),d.jsx("span",{children:t.allLabel})]})]}),f&&t.mode==="shell"&&d.jsxs("nav",{className:"bmc-rail","aria-label":t.allLabel,children:[d.jsxs("div",{className:"bmc-rail-cells",ref:a,children:[S.cells.map(T=>d.jsx(ao,{sp:T,badge:n[T.id]},T.id)),S.more.length>0&&d.jsxs("button",{className:"bmc-destination","data-chrome-action":"spacesAll","aria-current":S.more.some(T=>T.active)?"page":void 0,onClick:()=>ae("spacesAll"),children:[d.jsx(Zi,{size:22}),d.jsx("span",{children:t.allLabel})]})]}),e&&d.jsx("button",{className:"bmc-button bmc-account","aria-label":e.label,"data-chrome-action":"account",onClick:()=>e.activate(),children:e.avatar?d.jsx("img",{src:e.avatar,alt:""}):e.loggedIn?e.initial:d.jsx(Qi,{size:20})})]})]}),d.jsx(Wm,{})]})}function Qm(){try{return crypto.randomUUID()}catch{}const t=crypto.getRandomValues(new Uint8Array(16));return Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function Jm(t,e){const n="forsionMobileBack",s=history.state?.[n],i=typeof s=="string"?s:Qm();let r=s===i,o=!1,a=!1,u=0,l=!0;const c=()=>!t().boundary,h=()=>{if(!(!l||a||o))if(c()){if(r)return;const g=history.state&&typeof history.state=="object"?history.state:{};history.pushState({...g,[n]:i},"",location.href),r=!0}else r&&history.state?.[n]===i&&(o=!0,history.back())},f=()=>{u||(u=requestAnimationFrame(()=>{u=0,h()}))},p=g=>{if(o){o=!1,r=!1,f();return}if(g.state?.[n]===i){r=!0,f();return}if(!r)return;r=!1;const b=t();if(!b.boundary){a=!0;try{b.run()}finally{a=!1,f()}}};window.addEventListener("popstate",p);const m=e(f);return h(),()=>{l=!1,cancelAnimationFrame(u),m(),window.removeEventListener("popstate",p)}}function tp(){v.useEffect(()=>{const t=async()=>{if(!(!window.tangu?.mobile||Y.getState().connState!=="ok"))try{(await sl(Vl())).added&&(ve.getState().refreshList(),ve.getState().refreshUnread())}catch{}};t();const e=window.setInterval(t,5*6e4);let n=Y.getState().connState;const s=Y.subscribe(r=>{r.connState==="ok"&&n!=="ok"&&t(),n=r.connState}),i=()=>{document.hidden||t()};return document.addEventListener("visibilitychange",i),()=>{window.clearInterval(e),s(),document.removeEventListener("visibilitychange",i)}},[])}const ep=2e3;let rn=0;function da(){const{spaces:t,activeSpaceId:e}=je.getState(),n=t[0]?.id;if(n&&e!==n&&t.some(i=>i.id===e)){El(n);return}const s=Date.now();if(s-rn<ep||!Om()){rn=0,So.minimizeApp();return}rn=s}function co(){const{spaces:t,activeSpaceId:e}=je.getState();return{run:da,boundary:!t[0]||e===t[0].id}}function fa(){if(ln.getState().open)return{run:()=>ln.getState().close()};if(!window.dispatchEvent(new CustomEvent("forsion:mobile-back",{cancelable:!0,detail:{probe:!0}})))return{run:()=>{window.dispatchEvent(new Event("forsion:mobile-back",{cancelable:!0}))}};const e=Y.getState();if(e.onboarding)return{run:()=>{}};if(po(be.getState().webOpen,e.activeId))return{run:()=>be.getState().closeWeb()};if(e.marketOpen)return{run:()=>e.closeMarket()};if(e.settingsOpen)return{run:()=>e.closeSettings()};const n=cn.getState(),s=Al();if(s&&n.leftVisible)return co();if(n.leftVisible)return{slide:"left",run:()=>n.toggleSidebar("left")};if(n.rightVisible)return{slide:"right",run:()=>n.toggleSidebar("right")};const i=n.mainTabs.find(r=>r.active);if(i){const r=un.getState().stacks[i.id];if(r&&r.idx>0)return{run:()=>un.getState().back(i.id)};if(s)return{slide:"left",run:()=>n.toggleSidebar("left")};if(i.type!=="home"&&i.type!=="homepage")return{run:()=>{n.closeLeaf(i.id);const o=cn.getState().mainTabs.find(a=>a.active);o?.id===i.id&&o.type===i.type&&da()}}}return co()}function np(){v.useEffect(()=>{if(bs())return Jm(fa,t=>{const e=[cn.subscribe(t),un.subscribe(t),je.subscribe(t),ln.subscribe(t),be.subscribe(t),Bm(t),Y.subscribe((n,s)=>{(n.settingsOpen!==s.settingsOpen||n.marketOpen!==s.marketOpen||n.onboarding!==s.onboarding||n.activeId!==s.activeId||n.achievementsOpen!==s.achievementsOpen)&&t()})];return()=>{e.forEach(n=>n())}})},[])}function sp(){v.useEffect(()=>{if(!window.tangu?.mobile)return;const t=Im(),e=So.addListener("backButton",()=>{fa().run()}),n=()=>{};return document.addEventListener("visibilitychange",n),()=>{t(),document.removeEventListener("visibilitychange",n),e.then(s=>s.remove())}},[])}const ip={mode:"hidden"};function op(){ka(),tp(),sp(),np(),v.useEffect(()=>{Aa()},[]),v.useEffect(()=>{if(!Ts())return;const l=window.setTimeout(()=>{Qa()},1200);return()=>window.clearTimeout(l)},[]);const t=mo(),e=Ja();Ea();const n=Y(zf(l=>({sessions:l.sessions,archivedSessions:l.archivedSessions,activeId:l.activeId,settingsOpen:l.settingsOpen,settingsTab:l.settingsTab,settingsNonce:l.settingsNonce,marketOpen:l.marketOpen,marketTarget:l.marketTarget,onboarding:l.onboarding,setOnboarding:l.setOnboarding,achievementsOpen:l.achievementsOpen,cfg:l.cfg,closeSettings:l.closeSettings,patchConfig:l.patchConfig,connect:l.connect}))),s=n.sessions.find(l=>l.id===n.activeId)||n.archivedSessions.find(l=>l.id===n.activeId)||null,i=Yt(l=>l.open),r=v.useSyncExternalStore(Ma,ja),o=be(l=>po(l.webOpen,n.activeId));Tl(n.onboarding||n.achievementsOpen||i||o?ip:null),v.useEffect(()=>tl(!!n.onboarding),[n.onboarding]);const a=Cl(),u=Pl(l=>l.items.find(c=>c.id==="rb-account"))?.component;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"shell-host",children:d.jsx(kl,{dark:e.mode==="dark",buildDefault:Va})}),a&&u&&d.jsx("div",{hidden:!0,children:d.jsx(u,{expanded:!1})}),bs()&&d.jsx(Zm,{}),Ts()&&d.jsx(Ra,{}),d.jsx(el,{}),d.jsx(fl,{}),d.jsx(Da,{}),d.jsx(Nm,{}),r&&d.jsx(La,{params:r,onClose:()=>Na(null)}),d.jsx(se,{children:n.achievementsOpen&&d.jsx(re.div,{style:{position:"fixed",inset:0,zIndex:50,display:"flex",minWidth:0,minHeight:0,overflow:"hidden",background:"var(--bg)"},initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.985},transition:{duration:.22,ease:[.2,.8,.2,1]},children:d.jsx(Ia,{})},"achievements")}),d.jsx(se,{children:n.marketOpen&&d.jsx(re.div,{"data-mobile-market":!0,style:{position:"fixed",inset:0,zIndex:50,display:"flex",minWidth:0,minHeight:0,overflow:"hidden",background:"var(--bg)"},initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.985},transition:{duration:.22,ease:[.2,.8,.2,1]},children:d.jsx(Oa,{initialQuery:n.marketTarget?.q,initialItemId:n.marketTarget?.itemId,initialDetailTab:n.marketTarget?.detailTab,onClose:()=>Y.getState().closeMarket()},n.marketTarget?.nonce)},"market")}),d.jsx(se,{children:n.settingsOpen&&d.jsx(re.div,{style:{position:"fixed",inset:0,zIndex:50,display:"flex",minWidth:0,minHeight:0,overflow:"hidden",background:"var(--bg)"},initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.985},transition:{duration:.22,ease:[.2,.8,.2,1]},children:d.jsx(Fa,{open:!0,initialTab:n.settingsTab??void 0,cfg:n.cfg,activeSession:s,themeLang:t.lang,themeSkin:t.skin,themeMode:t.mode,themeModePref:t.modePref,flatOn:t.flat,glassOn:t.glass,themeSeed:t.seed,onClose:()=>n.closeSettings(),onConfigChange:n.patchConfig,onThemeChange:(l,c,h)=>t.setTheme(l,c,t.bg,h),onFlatChange:t.setFlat,onGlassChange:l=>t.setGlass(l),onSeedChange:l=>t.setSeedValue(l),onReloadThemes:()=>t.reloadThemes(),onReconnect:l=>{n.connect({...n.cfg,...l||{}})}},n.settingsNonce)},"settings")}),d.jsx(se,{children:n.onboarding&&d.jsx(re.div,{style:{position:"fixed",inset:0,zIndex:60,background:"var(--bg)"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:1.06},transition:{duration:.45,ease:[.2,.8,.2,1]},children:d.jsx(nl,{themeLang:t.lang,themeSkin:t.skin,themeMode:t.mode,themeModePref:t.modePref,themeSeed:t.seed,onThemeChange:(l,c,h)=>t.setTheme(l,c,t.bg,h),onSeedChange:l=>t.setSeedValue(l),onReconnect:()=>{},onFinish:()=>n.setOnboarding(!1)})},"onboarding")}),d.jsx(Ba,{page:!0}),!n.settingsOpen&&!n.marketOpen&&!n.onboarding&&d.jsx(za,{}),d.jsx(Ua,{onOpen:()=>Y.getState().openAchievements()}),d.jsx(Wa,{}),d.jsx($a,{}),d.jsx(_a,{})]})}Jt("SpaceShortcuts");Jt("LauncherIcon");Jt("LiveIsland");pt({"island.channel":{zh:"Agent 运行状态",en:"Agent activity"},"island.untitled":{zh:"新会话",en:"New chat"},"island.thinking":{zh:"思考中…",en:"Thinking…"},"island.writing":{zh:"正在回复…",en:"Writing a reply…"},"island.tool":{zh:"正在执行 {tool}",en:"Running {tool}"},"island.approval":{zh:"等你批准:{tool}",en:"Needs your approval: {tool}"},"island.inquiry":{zh:"有个问题等你回答",en:"Waiting for your answer"},"island.chipApproval":{zh:"待审批",en:"Approve"},"island.chipInquiry":{zh:"待回答",en:"Reply"},"island.more":{zh:"另有 {n} 个在跑",en:"{n} more running"},"island.done":{zh:"已完成",en:"Done"},"island.failed":{zh:"运行出错",en:"Failed"},"island.stopped":{zh:"已停止",en:"Stopped"},"island.allow":{zh:"允许",en:"Allow"},"island.deny":{zh:"拒绝",en:"Deny"},"island.eventsChannel":{zh:"消息与提醒",en:"Messages and reminders"}});Jt("NativeModelPicker");pt({"mobile.files.skipped":{zh:"有 {n} 个文件太大、太多或无法读取,没有添加:{names}",en:"{n} file(s) were too large, too many or unreadable and were not added: {names}"},"mobile.files.cameraDenied":{zh:"没有相机权限,无法拍照。可以在系统设置里允许 Forsion 使用相机。",en:"Camera access is off, so no photo was taken. You can allow it for Forsion in system settings."},"mobile.files.noCamera":{zh:"相机打不开。",en:"The camera could not be opened."},"mobile.files.noPicker":{zh:"系统的选择器打不开。",en:"The system picker could not be opened."}});pt({"mobile.share.title":{zh:"分享到 Forsion",en:"Share to Forsion"},"mobile.share.newChat":{zh:"发到新会话",en:"Send to a new chat"},"mobile.share.toSession":{zh:"发到「{name}」",en:"Send to “{name}”"},"mobile.share.toNote":{zh:"存为笔记",en:"Save as a note"},"mobile.share.note":{zh:"发到会话 = 放进输入框,由你来发。",en:"A chat gets it in the message box — you press send."},"mobile.share.files":{zh:"{n} 个文件",en:"{n} file(s)"},"mobile.share.saved":{zh:"已存为笔记「{name}」",en:"Saved as the note “{name}”"},"mobile.share.saveFailed":{zh:"没能存为笔记:{reason}",en:"Couldn’t save the note: {reason}"},"mobile.share.nameTaken":{zh:"同名笔记太多",en:"too many notes with that name"}});pt({"phone.row.label":{zh:"允许 Tangu 操作这台手机",en:"Allow Tangu to operate this phone"},"phone.row.hint":{zh:"在这台手机上发起的对话里,Tangu 可以打开 App 和链接、导航、设闹钟与计时、控制媒体和手电筒,并起草短信、邮件、电话和日程;发送、拨打、保存始终由你来按。",en:"In chats started on this phone, Tangu can open apps and links, start navigation, set alarms and timers, control media and the flashlight, and draft messages, emails, calls and events. Sending, calling and saving are always up to you."},"phone.row.privacy":{zh:"指令与草稿内容会经过 Forsion 云端,并保存在对话记录里。",en:"Commands and draft text pass through Forsion cloud and are stored in the conversation."}});Jt("PhoneControl");pt({"phone.native.enableTitle":{zh:"让 Tangu 操作这台手机?",en:"Let Tangu operate this phone?"},"phone.native.enableBody":{zh:`打开后,在这台手机上发起的对话里,Tangu 可以打开 App 和链接、导航、设闹钟与计时、控制媒体和手电筒,并替你起草短信、邮件、电话和日程——发送、拨打、保存始终由你来按。
|
|
10
|
+
|
|
11
|
+
指令与草稿内容会经过 Forsion 云端,并保存在对话记录里。随时可在设置里关闭。`,en:`When on, in chats started on this phone Tangu can open apps and links, start navigation, set alarms and timers, control media and the flashlight, and draft messages, emails, calls and events. You always press send, call or save yourself.
|
|
12
|
+
|
|
13
|
+
Commands and draft text pass through Forsion cloud and are stored in the conversation. You can turn this off in Settings at any time.`},"phone.native.enableConfirm":{zh:"允许",en:"Allow"},"phone.native.cancel":{zh:"取消",en:"Cancel"},"phone.native.confirmTitle":{zh:"打开其他 App?",en:"Open another app?"},"phone.native.confirmBody":{zh:"Tangu 想打开 {app}({target})。",en:"Tangu wants to open {app} ({target})."},"phone.native.confirmAllow":{zh:"打开",en:"Open"},"phone.native.confirmDeny":{zh:"拒绝",en:"Deny"}});const rp="button, a, summary, [role='button'], [role='tab'], [role='menuitem'], [role='option']",ap=80,lp=8,uo=260,cp=200,up="rgba(128, 128, 128, 0.2)";let ho=!1;function hp(){if(ho||typeof document>"u"||typeof Element.prototype.animate!="function")return;ho=!0;const t=document.createElement("div");t.className="tap-ripple",t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;left:0;top:0;width:0;height:0;overflow:hidden;pointer-events:none;z-index:2147483646;display:none;contain:strict";const e=document.createElement("i");e.style.cssText=`position:absolute;border-radius:50%;background:${up};will-change:transform`,t.appendChild(e),document.documentElement.appendChild(t),document.documentElement.dataset.ripple="";const n="currentCSSZoom"in Element.prototype,s=l=>{let c=!1,h=1;for(let f=l;f&&f!==document.documentElement;f=f.parentElement){const p=getComputedStyle(f);if(n||(h*=parseFloat(p.zoom)||1),!c&&f!==l&&(/auto|scroll/.test(p.overflowY)&&f.scrollHeight>f.clientHeight+1||/auto|scroll/.test(p.overflowX)&&f.scrollWidth>f.clientWidth+1)&&(c=!0),n&&c)break}return{scrolls:c,zoom:n?l.currentCSSZoom||1:h}};let i=null,r=null;const o=l=>{if(l.timer=0,!l.el.isConnected){i=null;return}const c=l.el.getBoundingClientRect(),h=n?1:l.zoom,f=c.left*h,p=c.top*h,m=c.width*h,g=c.height*h;if(m<1||g<1){i=null;return}const b=Math.min((parseFloat(getComputedStyle(l.el).borderTopLeftRadius)||0)*l.zoom,Math.min(m,g)/2);r?.cancel(),r=null,t.style.left=`${f}px`,t.style.top=`${p}px`,t.style.width=`${m}px`,t.style.height=`${g}px`,t.style.borderRadius=`${b}px`,t.style.display="block";const x=Math.min(Math.max(l.x-f,0),m),S=Math.min(Math.max(l.y-p,0),g),w=Math.hypot(Math.max(x,m-x),Math.max(S,g-S));e.style.left=`${x-w}px`,e.style.top=`${S-w}px`,e.style.width=e.style.height=`${w*2}px`,e.getAnimations().forEach(y=>y.cancel()),e.animate([{transform:"scale(0.12)"},{transform:"scale(1)"}],{duration:uo,easing:"cubic-bezier(0.2, 0, 0, 1)",fill:"forwards"}),l.shownAt=performance.now()},a=l=>{const c=performance.now()-l.shownAt,h=r=t.animate([{opacity:1},{opacity:0}],{duration:cp,delay:Math.max(0,uo*.6-c),fill:"forwards"});h.onfinish=()=>{r===h&&(t.style.display="none",h.cancel(),r=null)}},u=l=>{const c=i;i=null,c&&(c.timer&&(window.clearTimeout(c.timer),!l||(o(c),!c.shownAt))||a(c))};window.addEventListener("pointerdown",l=>{if(l.pointerType!=="touch"||!l.isPrimary)return;u(!1);const c=l.target?.closest?.(rp);if(!c||c.matches(':disabled, [aria-disabled="true"]'))return;const{scrolls:h,zoom:f}=s(c),p=i={el:c,x:l.clientX,y:l.clientY,zoom:f,timer:0,shownAt:0};h?p.timer=window.setTimeout(()=>{i===p&&o(p)},ap):o(p)},{capture:!0,passive:!0}),window.addEventListener("pointermove",l=>{i?.timer&&l.isPrimary&&Math.hypot(l.clientX-i.x,l.clientY-i.y)>lp&&u(!1)},{capture:!0,passive:!0}),window.addEventListener("pointerup",l=>{l.isPrimary&&u(!0)},{capture:!0,passive:!0}),window.addEventListener("pointercancel",l=>{l.isPrimary&&u(!1)},{capture:!0,passive:!0})}window.addEventListener("error",t=>{console.error("[tangu-mobile] window error:",t.error||t.message)});window.addEventListener("unhandledrejection",t=>{console.error("[tangu-mobile] unhandledrejection:",t.reason)});try{document.documentElement.lang=ga()==="zh"?"zh-CN":"en"}catch{}let ma,pa=null;try{ma=localStorage.getItem("forsion_theme_seed")||void 0}catch{}try{pa=localStorage.getItem("forsion_theme_lang")}catch{}try{il(ol(),rl(),al(),ll(),{customColor:ma}),cl(),document.documentElement.style.removeProperty("background"),mo.getState().initThemes(pa),Y.getState().setTr(ya),Ha(),!oo.isNativePlatform()&&!window.tangu?.mobile&&Km(),(oo.getPlatform()==="android"||bs())&&hp(),ul(),Ka(),hl(),Rm()}catch(t){console.error("[tangu-mobile] init failed, continue to mount:",t),dl("init",t)}ba.createRoot(document.getElementById("root")).render(d.jsx(va,{children:d.jsx(Ga,{children:d.jsx(op,{})})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,H as v,u as h,r as u,a as k}from"./index-YuejkHoJ.js";import{a as y}from"./ModelPill-DgyXBsL9.js";import{fd as x,az as P,kq as j,kr as L}from"./appStore-BskcSDl6.js";import{m as M}from"./tanguProbe-BboOas-a.js";import"./pageStore-D_fKLv-o.js";import"./nativeSheetMenu-CVC51DzC.js";import"./client-DD5czSuF.js";import"./dbStore-Bc2lC8ZI.js";import"./react-DOzedx9n.js";import"./ipc-8cxXGSZK.js";import"./nativeDownload-DlnT8U-y.js";import"./drawingStore-BD5m2eqn.js";k({"pluginmodel.localLabel":{zh:"SenseVoice · 本机",en:"SenseVoice · On-device"},"pluginmodel.localUnavailable":{zh:"请先在设置 → 语音中下载本机模型。",en:"Download the on-device model in Settings → Voice first."},"pluginmodel.unavailable":{zh:"模型目录暂不可用,请稍后重试。",en:"The model catalog is unavailable. Try again later."}});function S({options:l,revision:c,alive:o}){const{t:a}=h(),d=P(),i=j(e=>e.byKey.home?.models),[r,m]=u.useState({models:[],defaultModelId:""}),[p,t]=u.useState("");u.useEffect(()=>{let e=!1;return M(l.kind).then(n=>{!e&&o()&&(m(n),t(""))},()=>{!e&&o()&&t(a("pluginmodel.unavailable"))}),()=>{e=!0}},[i,l.kind,c,a]);const f=r.models.filter(e=>e.source!=="local").map(e=>({...e,source:e.source})),b=[{key:"follow",label:"",options:[{id:"",name:l.followLabel}]},...r.models.filter(e=>e.source==="local").map(e=>({key:`local:${e.id}`,label:"",options:[{id:e.id,name:a("pluginmodel.localLabel")+(e.available?"":" · "+a("pluginmodel.localUnavailable"))}]})),...L(f,d).map(e=>({key:e.key,label:e.provider,source:e.source,options:e.models}))];return s.jsxs("span",{className:"plugin-model-picker","aria-label":l.label,children:[s.jsx(y,{groups:b,modelId:l.value,thinkingLevel:"off",menuPortal:!0,icon:null,title:l.label,emptyLabel:l.value||l.followLabel,scopeKey:l.scopeKey,disabled:l.disabled,onSelect:e=>{if(!o())return;const n=r.models.find(g=>g.id===e);if(e&&!n?.available){t(a(n?.source==="local"?"pluginmodel.localUnavailable":"pluginmodel.unavailable"));return}t(""),l.onChange(e)}}),p&&s.jsx("span",{role:"alert",className:"hint",children:p})]})}function R(l,c){const o={...c};let a=!0,d=0;const i=()=>s.jsx(v,{children:s.jsx(S,{options:o,revision:d++,alive:()=>a})}),r=x(l,i(),()=>{a=!1});return{update(m){a&&(Object.assign(o,m),r.render(i()))},dispose:r.dispose}}export{R as mountPluginModelPicker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as f,a as A}from"./index-YuejkHoJ.js";import{c as L}from"./react-DOzedx9n.js";const j=[{id:"system.generic",labelKey:"ntf.event.system",defaultOn:!0},{id:"sync.error",labelKey:"ntf.event.syncError",defaultOn:!0},{id:"sync.done",labelKey:"ntf.event.syncDone",defaultOn:!0},{id:"sync.doneOnline",labelKey:"ntf.event.syncDoneOnline",defaultOn:!1},{id:"agent.done",labelKey:"ntf.event.agentDone",defaultOn:!0},{id:"inbox.message",labelKey:"ntf.event.inbox",defaultOn:!0},{id:"dm.waiting",labelKey:"ntf.event.dmWaiting",defaultOn:!0},{id:"note.reminder",labelKey:"ntf.event.noteReminder",defaultOn:!0},{id:"harness.candidates",labelKey:"ntf.event.harnessCandidates",defaultOn:!0},{id:"memory.projectCandidates",labelKey:"ntf.event.projectCandidates",defaultOn:!0},{id:"memory.projectCompacted",labelKey:"ntf.event.projectCompacted",defaultOn:!0}];function q(t){const o=j.find(r=>r.id===t);return o?o.defaultOn:!0}const S=4,x={success:3200,info:5e3,warning:8e3,error:0},F=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?Math.min(t,12e4):void 0,E=t=>t.durationMs??x[t.level],z="forsion.ntf.prefs";function C(){try{const t=localStorage.getItem(z);if(t)return{enabled:!0,osEnabled:!0,events:{},...JSON.parse(t)}}catch{}return{enabled:!0,osEnabled:!0,events:{}}}function D(t){try{localStorage.setItem(z,JSON.stringify(t))}catch{}}function k(t){return typeof window>"u"||!window.tangu?.mobile||!/Failed to fetch/i.test(t)?t:t.replace(/(?:TypeError:\s*)?Failed to fetch/gi,f("net.unavailable"))}const c=new Map;function g(t){const o=c.get(t);o?.handle&&clearTimeout(o.handle),c.delete(t)}let B=0;const R=L((t,o)=>{const r=(e,n)=>{if(g(e),!(n<=0)){if(o().paused){c.set(e,{handle:null,deadline:0,remaining:n});return}c.set(e,{handle:setTimeout(()=>o().dismiss(e),n),deadline:Date.now()+n,remaining:0})}},u=e=>{try{e?.onClose?.()}catch{}};return{items:[],queue:[],prefs:C(),paused:!1,notify:e=>{const n=e.level&&["info","success","warning","error"].includes(e.level)?e.level:"info",a=e.event??"system.generic",d=o();if(!e.force&&!e.receipt&&(!d.prefs.enabled||!(d.prefs.events[a]??q(a))))return null;const l=e.sticky??n==="error",m=F(e.durationMs),i=k(String(e.text??"")).slice(0,500),O=e.title?String(e.title).slice(0,120):void 0;if(e.dedupeKey){const s=d.items.find(h=>h.dedupeKey===e.dedupeKey)||d.queue.find(h=>h.dedupeKey===e.dedupeKey);if(s){const h=d.items.some(p=>p.id===s.id),b={...s,text:i,title:O??s.title,level:n,count:s.count+1,createdAt:Date.now(),sticky:l||s.sticky,action:"action"in e?e.action:s.action,durationMs:m??s.durationMs,onClose:e.onClose??s.onClose};return t(p=>({items:p.items.map(v=>v.id===s.id?b:v),queue:p.queue.map(v=>v.id===s.id?b:v)})),h&&(b.sticky?g(s.id):r(s.id,E(b))),s.id}}const y={id:`ntf-${++B}-${Date.now()}`,text:i,title:O,level:n,event:a,sourceLabel:e.sourceLabel,createdAt:Date.now(),sticky:l,count:1,dedupeKey:e.dedupeKey,action:e.action,durationMs:m,onClose:e.onClose},_=typeof document<"u"&&(!document.hasFocus()||document.visibilityState==="hidden");if(!e.inAppOnly&&!e.receipt&&d.prefs.osEnabled&&_){const s=O||e.sourceLabel||"Forsion";try{window.tangu?.notify?.(s,i,{event:a})}catch{}}return d.items.length<S?(t(s=>({items:[...s.items,y]})),l||r(y.id,E(y))):t(s=>({queue:[...s.queue,y]})),y.id},dismiss:e=>{g(e);const n=o(),a=n.items.find(i=>i.id===e)||n.queue.find(i=>i.id===e);let d=n.items.filter(i=>i.id!==e),l=n.queue.filter(i=>i.id!==e);if(d.length===n.items.length&&l.length===n.queue.length)return;const m=[];for(;d.length<S&&l.length;){const i=l[0];l=l.slice(1),d=[...d,i],m.push(i)}t({items:d,queue:l});for(const i of m)i.sticky||r(i.id,E(i));u(a)},dismissAll:()=>{for(const a of[...c.keys()])g(a);const{items:e,queue:n}=o();t({items:[],queue:[]});for(const a of[...e,...n])u(a)},setEnabled:e=>{const n={...o().prefs,enabled:e};t({prefs:n}),D(n)},setOsEnabled:e=>{const n={...o().prefs,osEnabled:e};t({prefs:n}),D(n)},setEventOn:(e,n)=>{const a={...o().prefs,events:{...o().prefs.events,[e]:n}};t({prefs:a}),D(a)},pause:()=>{if(!o().paused){t({paused:!0});for(const[e,n]of c)n.handle&&(clearTimeout(n.handle),c.set(e,{handle:null,deadline:0,remaining:Math.max(800,n.deadline-Date.now())}))}},resume:()=>{if(o().paused){t({paused:!1});for(const[e,n]of c)if(!n.handle){const a=n.remaining||1500;c.set(e,{handle:setTimeout(()=>o().dismiss(e),a),deadline:Date.now()+a,remaining:0})}}}}}),I=t=>R.getState().notify(t),w=50*1024*1024;A({"nativedl.saved":{zh:"已保存到「下载」:{name}",en:"Saved to Downloads: {name}"},"nativedl.tooLarge":{zh:"文件太大({size} MB),手机上一次最多保存 {max} MB",en:"File is too large ({size} MB); the phone can save up to {max} MB at a time"},"nativedl.unsupportedOs":{zh:"保存到「下载」需要 Android 10 及以上",en:"Saving to Downloads requires Android 10 or later"},"nativedl.failed":{zh:"保存到「下载」失败:{err}",en:"Could not save to Downloads: {err}"},"hostdl.failed":{zh:"下载失败({status})",en:"Download failed ({status})"},"hostdl.tooLarge":{zh:"文件太大({size} MB),远程下载一次最多 {max} MB",en:"File is too large ({size} MB); remote downloads are limited to {max} MB"},"hostdl.unsupported":{zh:"那台电脑上的 Forsion 版本还不支持远程下载文件",en:"Forsion on that computer does not support remote file downloads yet"}});function K(){return(typeof window<"u"?window.tangu?.saveDownload:void 0)??null}const N=t=>(t/1024/1024).toFixed(1);function M(t){return Object.assign(new Error(f("nativedl.tooLarge",{size:N(t),max:String(w/1024/1024)})),{code:"too_large"})}function U(t){const o=t?.code;if(o==="unsupported_os")return Object.assign(new Error(f("nativedl.unsupportedOs")),{code:o});const r=String(t?.message||t||"");return Object.assign(new Error(f("nativedl.failed",{err:r})),{code:typeof o=="string"?o:void 0})}async function T(t,o,r){const u=Number(r.headers.get("content-length"));if(Number.isFinite(u)&&u>w){try{await r.body?.cancel()}catch{}throw M(u)}const e=await r.blob();if(e.size>w)throw M(e.size);let n;try{n=(await t(o,e.type||"",e)).name||o}catch(a){throw a?.code==="too_large"?M(e.size):U(a)}return I({text:f("nativedl.saved",{name:n}),level:"info",inAppOnly:!0}),n}async function P(t,o){const r=K();if(r){await T(r,t,o);return}const u=await o.blob(),e=document.createElement("a");e.href=URL.createObjectURL(u),e.download=t,e.click(),setTimeout(()=>URL.revokeObjectURL(e.href),5e3)}async function V(t){let o={};try{o=await t.json()}catch{}return t.status===413&&o.code==="HOST_DOWNLOAD_TOO_LARGE"?Object.assign(new Error(f("hostdl.tooLarge",{size:N(Number(o.size)||0),max:String(Math.round((Number(o.limit)||0)/1024/1024))})),{status:413,code:"too_large"}):t.status===501?Object.assign(new Error(f("hostdl.unsupported")),{status:501}):Object.assign(new Error(f("hostdl.failed",{status:t.status})),{status:t.status})}const J=Object.freeze(Object.defineProperty({__proto__:null,NATIVE_DOWNLOAD_MAX_BYTES:w,hostDownloadError:V,nativeSaveDownload:K,saveResponseAs:P,saveResponseNative:T},Symbol.toStringTag,{value:"Module"}));export{j as N,J as a,q as e,V as h,I as n,P as s,R as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u}from"./index-YuejkHoJ.js";import{n as s,dB as m}from"./pageStore-D_fKLv-o.js";const d=t=>t.filter(n=>n.items.length).map(n=>({...n.title?{title:n.title}:{},...n.footer?{footer:n.footer}:{},items:n.items.map(e=>{const r=e.children?.filter(i=>i.items.length);return{id:e.id,label:e.label,...e.detail?{detail:e.detail}:{},...e.icon!=null&&e.icon!==!1?{icon:e.icon}:{},...e.checked?{checked:!0}:{},...e.danger?{danger:!0}:{},...e.disabled||!e.run&&!r?.length?{disabled:!0}:{},...r?.length?{children:d(r),...e.search?{search:e.search}:{}}:{}}})}));function h(t,n){for(const e of t)for(const r of e.items){if(r.id===n)return r;const i=r.children?h(r.children,n):void 0;if(i)return i}}const f=t=>t.sections.some(n=>n.items.length>0);async function v(t,n={}){if(!s()||!f(t))return!1;const e=await m({...t.title?{title:t.title}:{},sections:d(t.sections),...t.search?{search:t.search}:{},...t.back?{back:t.back}:{}},n.signal);if(n.signal?.aborted)return!0;if(!e.handled)return!1;try{n.onClose?.()}catch(i){console.error("[native sheet] onClose failed",i)}const r=e.value&&!e.value.trailing?h(t.sections,e.value.id):void 0;if(r&&!r.disabled&&r.run)try{r.run()}catch(i){console.error("[native sheet] menu action failed",i)}return!0}function N(t,n={}){if(!s())return!1;const e=t();return!e||!f(e)?!1:(v(e,{onClose:n.onClose}).then(r=>{r||n.onFallback?.()}),!0)}function S(t,n,e){const[r,i]=u.useState(null),a=u.useRef({build:n,onClose:e});a.current={build:n,onClose:e};const l=t!=null&&t!==!1,b=l&&r!==t&&!!s();return u.useEffect(()=>{if(!l){r!==null&&i(null);return}if(r===t||!s())return;const o=a.current.build();if(!o||!f(o)){i(t);return}const c=new AbortController;return v(o,{signal:c.signal,onClose:()=>a.current.onClose()}).then(g=>{!g&&!c.signal.aborted&&i(t)}),()=>c.abort()},[t,r,l]),!b}export{N as o,v as r,S as u};
|