opencami 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +111 -0
- package/bin/opencami.js +155 -0
- package/dist/client/apple-touch-icon-180x180.png +0 -0
- package/dist/client/assets/_sessionKey-B-MBYHgD.js +95 -0
- package/dist/client/assets/abap-BdImnpbu.js +1 -0
- package/dist/client/assets/actionscript-3-CfeIJUat.js +1 -0
- package/dist/client/assets/ada-bCR0ucgS.js +1 -0
- package/dist/client/assets/andromeeda-C-Jbm3Hp.js +1 -0
- package/dist/client/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/client/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/client/assets/apache-Pmp26Uib.js +1 -0
- package/dist/client/assets/apex-D8_7TLub.js +1 -0
- package/dist/client/assets/apl-dKokRX4l.js +1 -0
- package/dist/client/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/client/assets/ara-BRHolxvo.js +1 -0
- package/dist/client/assets/asciidoc-Dv7Oe6Be.js +1 -0
- package/dist/client/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/client/assets/astro-CbQHKStN.js +1 -0
- package/dist/client/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/client/assets/awk-DMzUqQB5.js +1 -0
- package/dist/client/assets/ayu-dark-CmMr59Fi.js +1 -0
- package/dist/client/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/client/assets/bat-BkioyH1T.js +1 -0
- package/dist/client/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/client/assets/berry-uYugtg8r.js +1 -0
- package/dist/client/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/client/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/client/assets/blade-D4QpJJKB.js +1 -0
- package/dist/client/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/client/assets/button-D_9OBT_f.js +1 -0
- package/dist/client/assets/c-BIGW1oBm.js +1 -0
- package/dist/client/assets/c3-VCDPK7BO.js +1 -0
- package/dist/client/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/client/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/client/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/client/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/client/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/client/assets/clarity-D53aC0YG.js +1 -0
- package/dist/client/assets/clojure-P80f7IUj.js +1 -0
- package/dist/client/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/client/assets/cobol-nwyudZeR.js +1 -0
- package/dist/client/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/client/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/client/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/client/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/client/assets/connect-BRasuRbB.js +2 -0
- package/dist/client/assets/coq-DkFqJrB1.js +1 -0
- package/dist/client/assets/cpp-CofmeUqb.js +1 -0
- package/dist/client/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/client/assets/csharp-K5feNrxe.js +1 -0
- package/dist/client/assets/css-DPfMkruS.js +1 -0
- package/dist/client/assets/csv-fuZLfV_i.js +1 -0
- package/dist/client/assets/cue-D82EKSYY.js +1 -0
- package/dist/client/assets/cypher-COkxafJQ.js +1 -0
- package/dist/client/assets/d-85-TOEBH.js +1 -0
- package/dist/client/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/client/assets/dart-CF10PKvl.js +1 -0
- package/dist/client/assets/dax-CEL-wOlO.js +1 -0
- package/dist/client/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/client/assets/diff-D97Zzqfu.js +1 -0
- package/dist/client/assets/docker-BcOcwvcX.js +1 -0
- package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/client/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/client/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/client/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/client/assets/edge-BkV0erSs.js +1 -0
- package/dist/client/assets/elixir-CDX3lj18.js +1 -0
- package/dist/client/assets/elm-DbKCFpqz.js +1 -0
- package/dist/client/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/client/assets/erb-BOJIQeun.js +1 -0
- package/dist/client/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/client/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/client/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/client/assets/fennel-BYunw83y.js +1 -0
- package/dist/client/assets/file-explorer-screen-Daf4rIq9.js +1 -0
- package/dist/client/assets/files-ByeIMLfw.js +2 -0
- package/dist/client/assets/fish-BvzEVeQv.js +1 -0
- package/dist/client/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/client/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/client/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/client/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/client/assets/gdresource-B7Tvp0Sc.js +1 -0
- package/dist/client/assets/gdscript-DTMYz4Jt.js +1 -0
- package/dist/client/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/client/assets/genie-D0YGMca9.js +1 -0
- package/dist/client/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/client/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/client/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/client/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/client/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/client/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/client/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/client/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/client/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/client/assets/gleam-BspZqrRM.js +1 -0
- package/dist/client/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/client/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/client/assets/glsl-DplSGwfg.js +1 -0
- package/dist/client/assets/gn-n2N0HUVH.js +1 -0
- package/dist/client/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/client/assets/go-Dn2_MT6a.js +1 -0
- package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/client/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/client/assets/hack-CaT9iCJl.js +1 -0
- package/dist/client/assets/haml-B8DHNrY2.js +1 -0
- package/dist/client/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/client/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/client/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/client/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/client/assets/hjson-D5-asLiD.js +1 -0
- package/dist/client/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/client/assets/houston-DnULxvSX.js +1 -0
- package/dist/client/assets/html-GMplVEZG.js +1 -0
- package/dist/client/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/client/assets/http-jrhK8wxY.js +1 -0
- package/dist/client/assets/hurl-irOxFIW8.js +1 -0
- package/dist/client/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/client/assets/hy-DFXneXwc.js +1 -0
- package/dist/client/assets/imba-DGztddWO.js +1 -0
- package/dist/client/assets/index-ByUDBI-n.js +14 -0
- package/dist/client/assets/index-DHGnKfAU.js +1 -0
- package/dist/client/assets/ini-BEwlwnbL.js +1 -0
- package/dist/client/assets/java-CylS5w8V.js +1 -0
- package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/client/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/client/assets/jison-wvAkD_A8.js +1 -0
- package/dist/client/assets/json-Cp-IABpG.js +1 -0
- package/dist/client/assets/json5-C9tS-k6U.js +1 -0
- package/dist/client/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/client/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/client/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/client/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/client/assets/julia-CxzCAyBv.js +1 -0
- package/dist/client/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/client/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/client/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/client/assets/kdl-DV7GczEv.js +1 -0
- package/dist/client/assets/keyboard-shortcuts-dialog-agsWJ36q.js +1 -0
- package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/client/assets/kusto-DZf3V79B.js +1 -0
- package/dist/client/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/client/assets/latex-B4uzh10-.js +1 -0
- package/dist/client/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/client/assets/less-B1dDrJ26.js +1 -0
- package/dist/client/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/client/assets/liquid-DYVedYrR.js +1 -0
- package/dist/client/assets/llvm-BtvRca6l.js +1 -0
- package/dist/client/assets/log-2UxHyX5q.js +1 -0
- package/dist/client/assets/logo-BtOb2qkB.js +1 -0
- package/dist/client/assets/lua-BbnMAYS6.js +1 -0
- package/dist/client/assets/luau-C-HG3fhB.js +1 -0
- package/dist/client/assets/main-BAHT5yqU.js +81 -0
- package/dist/client/assets/make-CHLpvVh8.js +1 -0
- package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/client/assets/marko-DZsq8hO1.js +1 -0
- package/dist/client/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/client/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/client/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/client/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/client/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/client/assets/matlab-D7o27uSR.js +1 -0
- package/dist/client/assets/mdc-DUICxH0z.js +1 -0
- package/dist/client/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/client/assets/menu-BhVaz8Ly.js +20 -0
- package/dist/client/assets/mermaid-mWjccvbQ.js +1 -0
- package/dist/client/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/client/assets/min-light-CTRr51gU.js +1 -0
- package/dist/client/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/client/assets/mojo-B93PlW-d.js +1 -0
- package/dist/client/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/client/assets/moonbit-Ba13S78F.js +1 -0
- package/dist/client/assets/move-Bu9oaDYs.js +1 -0
- package/dist/client/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/client/assets/new-DLlBm66g.js +1 -0
- package/dist/client/assets/nextflow-BrzmwbiE.js +1 -0
- package/dist/client/assets/nginx-DknmC5AR.js +1 -0
- package/dist/client/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/client/assets/nim-CVrawwO9.js +1 -0
- package/dist/client/assets/nix-CwoSXNpI.js +1 -0
- package/dist/client/assets/nord-Ddv68eIx.js +1 -0
- package/dist/client/assets/nushell-C-sUppwS.js +1 -0
- package/dist/client/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/client/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/client/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/client/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/client/assets/one-light-PoHY5YXO.js +1 -0
- package/dist/client/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/client/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/client/assets/perl-C0TMdlhV.js +1 -0
- package/dist/client/assets/php-CDn_0X-4.js +1 -0
- package/dist/client/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/client/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/client/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/client/assets/po-BTJTHyun.js +1 -0
- package/dist/client/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/client/assets/polar-C0HS_06l.js +1 -0
- package/dist/client/assets/postcss-CXtECtnM.js +1 -0
- package/dist/client/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/client/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/client/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/client/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/client/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/client/assets/pug-CGlum2m_.js +1 -0
- package/dist/client/assets/puppet-BMWR74SV.js +1 -0
- package/dist/client/assets/purescript-CklMAg4u.js +1 -0
- package/dist/client/assets/python-B6aJPvgy.js +1 -0
- package/dist/client/assets/qml-3beO22l8.js +1 -0
- package/dist/client/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/client/assets/qss-IeuSbFQv.js +1 -0
- package/dist/client/assets/r-Dspwwk_N.js +1 -0
- package/dist/client/assets/racket-BqYA7rlc.js +1 -0
- package/dist/client/assets/raku-DXvB9xmW.js +1 -0
- package/dist/client/assets/razor-C1TweQQi.js +1 -0
- package/dist/client/assets/red-bN70gL4F.js +1 -0
- package/dist/client/assets/reg-C-SQnVFl.js +1 -0
- package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/client/assets/rel-C3B-1QV4.js +1 -0
- package/dist/client/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/client/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/client/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/client/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/client/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/client/assets/rst-B0xPkSld.js +1 -0
- package/dist/client/assets/ruby-BvKwtOVI.js +1 -0
- package/dist/client/assets/rust-B1yitclQ.js +1 -0
- package/dist/client/assets/sas-cz2c8ADy.js +1 -0
- package/dist/client/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/client/assets/scala-C151Ov-r.js +1 -0
- package/dist/client/assets/scheme-C98Dy4si.js +1 -0
- package/dist/client/assets/scss-OYdSNvt2.js +1 -0
- package/dist/client/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/client/assets/search-dialog-CHwnOyPS.js +1 -0
- package/dist/client/assets/session-export-dialog-uOlDUzgX.js +1 -0
- package/dist/client/assets/settings-dialog-D0aYDkAM.js +1 -0
- package/dist/client/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/client/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/client/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/client/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/client/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/client/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/client/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/client/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/client/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/client/assets/solidity-rGO070M0.js +1 -0
- package/dist/client/assets/soy-Brmx7dQM.js +1 -0
- package/dist/client/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/client/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/client/assets/sql-BLtJtn59.js +1 -0
- package/dist/client/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/client/assets/stata-BH5u7GGu.js +1 -0
- package/dist/client/assets/styles-7aVSlb6l.css +1 -0
- package/dist/client/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/client/assets/svelte-zxCyuUbr.js +1 -0
- package/dist/client/assets/swift-Dg5xB15N.js +1 -0
- package/dist/client/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/client/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/client/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/client/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/client/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/client/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/client/assets/templ-W15q3VgB.js +1 -0
- package/dist/client/assets/terraform-BETggiCN.js +1 -0
- package/dist/client/assets/tex-CvyZ59Mk.js +1 -0
- package/dist/client/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/client/assets/toml-vGWfd6FD.js +1 -0
- package/dist/client/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/client/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/client/assets/tsx-COt5Ahok.js +1 -0
- package/dist/client/assets/turtle-BsS91CYL.js +1 -0
- package/dist/client/assets/twig-CO9l9SDP.js +1 -0
- package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/client/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/client/assets/typst-DHCkPAjA.js +1 -0
- package/dist/client/assets/v-BcVCzyr7.js +1 -0
- package/dist/client/assets/vala-CsfeWuGM.js +1 -0
- package/dist/client/assets/vb-D17OF-Vu.js +1 -0
- package/dist/client/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/client/assets/vesper-DU1UobuO.js +1 -0
- package/dist/client/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/client/assets/viml-CJc9bBzg.js +1 -0
- package/dist/client/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/client/assets/vue-DN_0RTcg.js +1 -0
- package/dist/client/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/client/assets/vue-vine-CQOfvN7w.js +1 -0
- package/dist/client/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/client/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/client/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/client/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/client/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/client/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/client/assets/wit-5i3qLPDT.js +1 -0
- package/dist/client/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/client/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/client/assets/yaml-Buea-lGh.js +1 -0
- package/dist/client/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/client/assets/zig-VOosw3JB.js +1 -0
- package/dist/client/cover.jpg +0 -0
- package/dist/client/cover.webp +0 -0
- package/dist/client/favicon.svg +4 -0
- package/dist/client/manifest.json +40 -0
- package/dist/client/pwa-192x192.png +0 -0
- package/dist/client/pwa-512x512.png +0 -0
- package/dist/client/pwa-maskable-512x512.png +0 -0
- package/dist/client/robots.txt +3 -0
- package/dist/client/screenshot-file-explorer.png +0 -0
- package/dist/client/sw.js +165 -0
- package/dist/server/assets/_sessionKey-qlAPF_Ft.js +6130 -0
- package/dist/server/assets/_tanstack-start-manifest_v-El8F-kd-.js +4 -0
- package/dist/server/assets/button-DtQ3rV1m.js +53 -0
- package/dist/server/assets/connect-BWI_6rCm.js +80 -0
- package/dist/server/assets/file-explorer-screen-DJXPEG_J.js +2450 -0
- package/dist/server/assets/files-CONoVTGD.js +11 -0
- package/dist/server/assets/index-Bp8QskbI.js +28 -0
- package/dist/server/assets/index-COu2idHm.js +226 -0
- package/dist/server/assets/keyboard-shortcuts-dialog-D5hqVX2v.js +69 -0
- package/dist/server/assets/menu-D6n4DB0U.js +156 -0
- package/dist/server/assets/new-Dzk5YxE9.js +6 -0
- package/dist/server/assets/router-DbxyvprK.js +2749 -0
- package/dist/server/assets/search-dialog-JY8C3mqa.js +443 -0
- package/dist/server/assets/session-export-dialog-D87uafPD.js +80 -0
- package/dist/server/assets/settings-dialog-CBj7njLM.js +568 -0
- package/dist/server/assets/start-HYkvq4Ni.js +4 -0
- package/dist/server/server.js +1013 -0
- package/package.json +93 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{S as Bc,p as Ni,e as ft,s as Ts,f as Dn,n as Es,i as Hr,h as Bi,t as ad,k as es,l as cd,m as ld,o as ji,q as Gs,v as Ui,w as ud,r as h,x as Eo,u as jc,j as $,y as Uc,a as yt,z as fd,A as dd}from"./main-BAHT5yqU.js";import{f as Je,u as it,_ as rt,a as ze,b as Cs,$ as Wc,a0 as Hc,a1 as Ps,c as Pt,a2 as Ms,a3 as Wi,B as hd}from"./button-D_9OBT_f.js";var pd=class extends Bc{constructor(e,t){super(),this.options=t,this.#n=e,this.#a=null,this.#i=Ni(),this.bindMethods(),this.setOptions(t)}#n;#e=void 0;#s=void 0;#t=void 0;#r;#o;#i;#a;#m;#d;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Hi(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $r(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $r(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#R(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#n.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ft(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!Ts(this.options,t)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&$i(this.#e,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#e!==n||ft(this.options.enabled,this.#e)!==ft(t.enabled,this.#e)||Dn(this.options.staleTime,this.#e)!==Dn(t.staleTime,this.#e))&&this.#g();const r=this.#y();s&&(this.#e!==n||ft(this.options.enabled,this.#e)!==ft(t.enabled,this.#e)||r!==this.#c)&&this.#v(r)}getOptimisticResult(e){const t=this.#n.getQueryCache().build(this.#n,e),n=this.createResult(t,e);return gd(this,n)&&(this.#t=n,this.#o=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#t}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#n.defaultQueryOptions(e),n=this.#n.getQueryCache().build(this.#n,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#f(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Es)),t}#g(){this.#x();const e=Dn(this.options.staleTime,this.#e);if(Hr||this.#t.isStale||!Bi(e))return;const n=ad(this.#t.dataUpdatedAt,e)+1;this.#l=es.setTimeout(()=>{this.#t.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#R(),this.#c=e,!(Hr||ft(this.options.enabled,this.#e)===!1||!Bi(this.#c)||this.#c===0)&&(this.#u=es.setInterval(()=>{(this.options.refetchIntervalInBackground||cd.isFocused())&&this.#f()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#l&&(es.clearTimeout(this.#l),this.#l=void 0)}#R(){this.#u&&(es.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,s=this.options,r=this.#t,o=this.#r,i=this.#o,c=e!==n?e.state:this.#s,{state:l}=e;let u={...l},f=!1,d;if(t._optimisticResults){const S=this.hasListeners(),O=!S&&Hi(e,t),A=S&&$i(e,n,t,s);(O||A)&&(u={...u,...ld(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=u;d=u.data;let x=!1;if(t.placeholderData!==void 0&&d===void 0&&g==="pending"){let S;r?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(S=r.data,x=!0):S=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,S!==void 0&&(g="success",d=ji(r?.data,S,t),f=!0)}if(t.select&&d!==void 0&&!x)if(r&&d===o?.data&&t.select===this.#m)d=this.#d;else try{this.#m=t.select,d=t.select(d),d=ji(r?.data,d,t),this.#d=d,this.#a=null}catch(S){this.#a=S}this.#a&&(p=this.#a,d=this.#d,m=Date.now(),g="error");const y=u.fetchStatus==="fetching",v=g==="pending",R=g==="error",w=v&&y,b=d!==void 0,E={status:g,fetchStatus:u.fetchStatus,isPending:v,isSuccess:g==="success",isError:R,isInitialLoading:w,isLoading:w,data:d,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:R&&!b,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:R&&b,isStale:Co(e,t),refetch:this.refetch,promise:this.#i,isEnabled:ft(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const S=E.data!==void 0,O=E.status==="error"&&!S,A=C=>{O?C.reject(E.error):S&&C.resolve(E.data)},L=()=>{const C=this.#i=E.promise=Ni();A(C)},I=this.#i;switch(I.status){case"pending":e.queryHash===n.queryHash&&A(I);break;case"fulfilled":(O||E.data!==I.value)&&L();break;case"rejected":(!O||E.error!==I.reason)&&L();break}}return E}updateResult(){const e=this.#t,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#o=this.options,this.#r.data!==void 0&&(this.#h=this.#e),Ts(t,e))return;this.#t=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,r=typeof s=="function"?s():s;if(r==="all"||!r&&!this.#p.size)return!0;const o=new Set(r??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#t).some(i=>{const a=i;return this.#t[a]!==e[a]&&o.has(a)})};this.#S({listeners:n()})}#w(){const e=this.#n.getQueryCache().build(this.#n,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Gs.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#t)}),this.#n.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function md(e,t){return ft(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Hi(e,t){return md(e,t)||e.state.data!==void 0&&$r(e,t,t.refetchOnMount)}function $r(e,t,n){if(ft(t.enabled,e)!==!1&&Dn(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Co(e,t)}return!1}function $i(e,t,n,s){return(e!==t||ft(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Co(e,n)}function Co(e,t){return ft(t.enabled,e)!==!1&&e.isStaleByTime(Dn(t.staleTime,e))}function gd(e,t){return!Ts(e.getCurrentResult(),t)}var yd=class extends Bc{#n;#e=void 0;#s;#t;constructor(t,n){super(),this.#n=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#n.defaultMutationOptions(t),Ts(this.options,n)||this.#n.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ui(n.mutationKey)!==Ui(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#o()}mutate(t,n){return this.#t=n,this.#s?.removeObserver(this),this.#s=this.#n.getMutationCache().build(this.#n,this.options),this.#s.addObserver(this),this.#s.execute(t)}#r(){const t=this.#s?.state??ud();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Gs.batch(()=>{if(this.#t&&this.hasListeners()){const n=this.#e.variables,s=this.#e.context,r={client:this.#n,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#t.onSuccess?.(t.data,n,s,r)}catch(o){Promise.reject(o)}try{this.#t.onSettled?.(t.data,null,n,s,r)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#t.onError?.(t.error,n,s,r)}catch(o){Promise.reject(o)}try{this.#t.onSettled?.(void 0,t.error,n,s,r)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#e)})})}},$c=h.createContext(!1),vd=()=>h.useContext($c);$c.Provider;function bd(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xd=h.createContext(bd()),Rd=()=>h.useContext(xd),wd=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Eo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},Sd=e=>{h.useEffect(()=>{e.clearReset()},[e])},Td=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||Eo(n,[e.error,s])),Ed=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Cd=(e,t)=>e.isLoading&&e.isFetching&&!t,Pd=(e,t)=>e?.suspense&&t.isPending,Ki=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Md(e,t,n){const s=vd(),r=Rd(),o=jc(),i=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=o.getQueryCache().get(i.queryHash);i._optimisticResults=s?"isRestoring":"optimistic",Ed(i),wd(i,r,a),Sd(r);const c=!o.getQueryCache().get(i.queryHash),[l]=h.useState(()=>new t(o,i)),u=l.getOptimisticResult(i),f=!s&&e.subscribed!==!1;if(h.useSyncExternalStore(h.useCallback(d=>{const p=f?l.subscribe(Gs.batchCalls(d)):Es;return l.updateResult(),p},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),h.useEffect(()=>{l.setOptions(i)},[i,l]),Pd(i,u))throw Ki(i,l,r);if(Td({result:u,errorResetBoundary:r,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw u.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(i,u),i.experimental_prefetchInRender&&!Hr&&Cd(u,s)&&(c?Ki(i,l,r):a?.promise)?.catch(Es).finally(()=>{l.updateResult()}),i.notifyOnChangeProps?u:l.trackResult(u)}function tw(e,t){return Md(e,pd)}function nw(e,t){const n=jc(),[s]=h.useState(()=>new yd(n,e));h.useEffect(()=>{s.setOptions(e)},[s,e]);const r=h.useSyncExternalStore(h.useCallback(i=>s.subscribe(Gs.batchCalls(i)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=h.useCallback((i,a)=>{s.mutate(i,a).catch(Es)},[s]);if(r.error&&Eo(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const Od=500,Ad=500,Id={style:{transition:"none"}},Dd="data-base-ui-click-trigger",kd={fallbackAxisSide:"none"},Kc={fallbackAxisSide:"end"},Ld={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Os={isSidebarCollapsed:!1},_c=["chat","ui"];function sw(e){const t=e.getQueryData(_c);return t&&typeof t=="object"?{...Os,...t}:Os}function rw(e,t){e.setQueryData(_c,function(s){const r=s&&typeof s=="object"?{...Os,...s}:Os;return t(r)})}const Po=h.createContext({});function Mo(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yc=typeof window<"u",Gc=Yc?h.useLayoutEffect:h.useEffect,zs=h.createContext(null);function Oo(e,t){e.indexOf(t)===-1&&e.push(t)}function Ao(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const vt=(e,t,n)=>n>t?t:n<e?e:n;let Io=()=>{};const Et={},zc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Xc(e){return typeof e=="object"&&e!==null}const qc=e=>/^0[^.\s]+$/u.test(e);function Do(e){let t;return()=>(t===void 0&&(t=e()),t)}const ot=e=>e,Vd=(e,t)=>n=>t(e(n)),Yn=(...e)=>e.reduce(Vd),Un=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class ko{constructor(){this.subscriptions=[]}add(t){return Oo(this.subscriptions,t),()=>Ao(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let o=0;o<r;o++){const i=this.subscriptions[o];i&&i(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Tt=e=>e*1e3,nt=e=>e/1e3;function Qc(e,t){return t?e*(1e3/t):0}const Zc=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Fd=1e-7,Nd=12;function Bd(e,t,n,s,r){let o,i,a=0;do i=t+(n-t)/2,o=Zc(i,s,r)-e,o>0?n=i:t=i;while(Math.abs(o)>Fd&&++a<Nd);return i}function Gn(e,t,n,s){if(e===t&&n===s)return ot;const r=o=>Bd(o,0,1,e,n);return o=>o===0||o===1?o:Zc(r(o),t,s)}const Jc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,el=e=>t=>1-e(1-t),tl=Gn(.33,1.53,.69,.99),Lo=el(tl),nl=Jc(Lo),sl=e=>(e*=2)<1?.5*Lo(e):.5*(2-Math.pow(2,-10*(e-1))),Vo=e=>1-Math.sin(Math.acos(e)),rl=el(Vo),ol=Jc(Vo),jd=Gn(.42,0,1,1),Ud=Gn(0,0,.58,1),il=Gn(.42,0,.58,1),Wd=e=>Array.isArray(e)&&typeof e[0]!="number",al=e=>Array.isArray(e)&&typeof e[0]=="number",Hd={linear:ot,easeIn:jd,easeInOut:il,easeOut:Ud,circIn:Vo,circInOut:ol,circOut:rl,backIn:Lo,backInOut:nl,backOut:tl,anticipate:sl},$d=e=>typeof e=="string",_i=e=>{if(al(e)){Io(e.length===4);const[t,n,s,r]=e;return Gn(t,n,s,r)}else if($d(e))return Hd[e];return e},ts=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Kd(e,t){let n=new Set,s=new Set,r=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){i.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,f=!1,d=!1)=>{const m=d&&r?n:s;return f&&i.add(u),m.has(u)||m.add(u),u},cancel:u=>{s.delete(u),i.delete(u)},process:u=>{if(a=u,r){o=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}const _d=40;function cl(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=ts.reduce((R,w)=>(R[w]=Kd(o),R),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:f,preRender:d,render:p,postRender:m}=i,g=()=>{const R=Et.useManualTiming?r.timestamp:performance.now();n=!1,Et.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(R-r.timestamp,_d),1)),r.timestamp=R,r.isProcessing=!0,a.process(r),c.process(r),l.process(r),u.process(r),f.process(r),d.process(r),p.process(r),m.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(g))},x=()=>{n=!0,s=!0,r.isProcessing||e(g)};return{schedule:ts.reduce((R,w)=>{const b=i[w];return R[w]=(T,E=!1,S=!1)=>(n||x(),b.schedule(T,E,S)),R},{}),cancel:R=>{for(let w=0;w<ts.length;w++)i[ts[w]].cancel(R)},state:r,steps:i}}const{schedule:Re,cancel:Ft,state:Ve,steps:gr}=cl(typeof requestAnimationFrame<"u"?requestAnimationFrame:ot,!0);let ms;function Yd(){ms=void 0}const $e={now:()=>(ms===void 0&&$e.set(Ve.isProcessing||Et.useManualTiming?Ve.timestamp:performance.now()),ms),set:e=>{ms=e,queueMicrotask(Yd)}},ll=e=>t=>typeof t=="string"&&t.startsWith(e),ul=ll("--"),Gd=ll("var(--"),Fo=e=>Gd(e)?zd.test(e.split("/*")[0].trim()):!1,zd=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yi(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const xn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Wn={...xn,transform:e=>vt(0,1,e)},ns={...xn,default:1},kn=e=>Math.round(e*1e5)/1e5,No=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Xd(e){return e==null}const qd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bo=(e,t)=>n=>!!(typeof n=="string"&&qd.test(n)&&n.startsWith(e)||t&&!Xd(n)&&Object.prototype.hasOwnProperty.call(n,t)),fl=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,o,i,a]=s.match(No);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Qd=e=>vt(0,255,e),yr={...xn,transform:e=>Math.round(Qd(e))},Yt={test:Bo("rgb","red"),parse:fl("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+yr.transform(e)+", "+yr.transform(t)+", "+yr.transform(n)+", "+kn(Wn.transform(s))+")"};function Zd(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Kr={test:Bo("#"),parse:Zd,transform:Yt.transform},zn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ot=zn("deg"),pt=zn("%"),_=zn("px"),Jd=zn("vh"),eh=zn("vw"),Gi={...pt,parse:e=>pt.parse(e)/100,transform:e=>pt.transform(e*100)},sn={test:Bo("hsl","hue"),parse:fl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+pt.transform(kn(t))+", "+pt.transform(kn(n))+", "+kn(Wn.transform(s))+")"},Oe={test:e=>Yt.test(e)||Kr.test(e)||sn.test(e),parse:e=>Yt.test(e)?Yt.parse(e):sn.test(e)?sn.parse(e):Kr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Yt.transform(e):sn.transform(e),getAnimatableNone:e=>{const t=Oe.parse(e);return t.alpha=0,Oe.transform(t)}},th=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nh(e){return isNaN(e)&&typeof e=="string"&&(e.match(No)?.length||0)+(e.match(th)?.length||0)>0}const dl="number",hl="color",sh="var",rh="var(",zi="${}",oh=/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 Hn(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace(oh,c=>(Oe.test(c)?(s.color.push(o),r.push(hl),n.push(Oe.parse(c))):c.startsWith(rh)?(s.var.push(o),r.push(sh),n.push(c)):(s.number.push(o),r.push(dl),n.push(parseFloat(c))),++o,zi)).split(zi);return{values:n,split:a,indexes:s,types:r}}function pl(e){return Hn(e).values}function ml(e){const{split:t,types:n}=Hn(e),s=t.length;return r=>{let o="";for(let i=0;i<s;i++)if(o+=t[i],r[i]!==void 0){const a=n[i];a===dl?o+=kn(r[i]):a===hl?o+=Oe.transform(r[i]):o+=r[i]}return o}}const ih=e=>typeof e=="number"?0:Oe.test(e)?Oe.getAnimatableNone(e):e;function ah(e){const t=pl(e);return ml(e)(t.map(ih))}const Nt={test:nh,parse:pl,createTransformer:ml,getAnimatableNone:ah};function vr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ch({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,o=0,i=0;if(!t)r=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=vr(c,a,e+1/3),o=vr(c,a,e),i=vr(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:s}}function As(e,t){return n=>n>0?t:e}const Ee=(e,t,n)=>e+(t-e)*n,br=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},lh=[Kr,Yt,sn],uh=e=>lh.find(t=>t.test(e));function Xi(e){const t=uh(e);if(!t)return!1;let n=t.parse(e);return t===sn&&(n=ch(n)),n}const qi=(e,t)=>{const n=Xi(e),s=Xi(t);if(!n||!s)return As(e,t);const r={...n};return o=>(r.red=br(n.red,s.red,o),r.green=br(n.green,s.green,o),r.blue=br(n.blue,s.blue,o),r.alpha=Ee(n.alpha,s.alpha,o),Yt.transform(r))},_r=new Set(["none","hidden"]);function fh(e,t){return _r.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function dh(e,t){return n=>Ee(e,t,n)}function jo(e){return typeof e=="number"?dh:typeof e=="string"?Fo(e)?As:Oe.test(e)?qi:mh:Array.isArray(e)?gl:typeof e=="object"?Oe.test(e)?qi:hh:As}function gl(e,t){const n=[...e],s=n.length,r=e.map((o,i)=>jo(o)(o,t[i]));return o=>{for(let i=0;i<s;i++)n[i]=r[i](o);return n}}function hh(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=jo(e[r])(e[r],t[r]));return r=>{for(const o in s)n[o]=s[o](r);return n}}function ph(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],i=e.indexes[o][s[o]],a=e.values[i]??0;n[r]=a,s[o]++}return n}const mh=(e,t)=>{const n=Nt.createTransformer(t),s=Hn(e),r=Hn(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?_r.has(e)&&!r.values.length||_r.has(t)&&!s.values.length?fh(e,t):Yn(gl(ph(s,r),r.values),n):As(e,t)};function yl(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ee(e,t,n):jo(e)(e,t)}const gh=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Re.update(t,n),stop:()=>Ft(t),now:()=>Ve.isProcessing?Ve.timestamp:$e.now()}},vl=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)s+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Is=2e4;function Uo(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Is;)t+=n,s=e.next(t);return t>=Is?1/0:t}function yh(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Uo(s),Is);return{type:"keyframes",ease:o=>s.next(r*o).value/t,duration:nt(r)}}const vh=5;function bl(e,t,n){const s=Math.max(t-vh,0);return Qc(n-e(s),t-s)}const Pe={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},xr=.001;function bh({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:n=Pe.velocity,mass:s=Pe.mass}){let r,o,i=1-t;i=vt(Pe.minDamping,Pe.maxDamping,i),e=vt(Pe.minDuration,Pe.maxDuration,nt(e)),i<1?(r=l=>{const u=l*i,f=u*e,d=u-n,p=Yr(l,i),m=Math.exp(-f);return xr-d/p*m},o=l=>{const f=l*i*e,d=f*n+n,p=Math.pow(i,2)*Math.pow(l,2)*e,m=Math.exp(-f),g=Yr(Math.pow(l,2),i);return(-r(l)+xr>0?-1:1)*((d-p)*m)/g}):(r=l=>{const u=Math.exp(-l*e),f=(l-n)*e+1;return-xr+u*f},o=l=>{const u=Math.exp(-l*e),f=(n-l)*(e*e);return u*f});const a=5/e,c=Rh(r,o,a);if(e=Tt(e),isNaN(c))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:i*2*Math.sqrt(s*l),duration:e}}}const xh=12;function Rh(e,t,n){let s=n;for(let r=1;r<xh;r++)s=s-e(s)/t(s);return s}function Yr(e,t){return e*Math.sqrt(1-t*t)}const wh=["duration","bounce"],Sh=["stiffness","damping","mass"];function Qi(e,t){return t.some(n=>e[n]!==void 0)}function Th(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!Qi(e,Sh)&&Qi(e,wh))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,o=2*vt(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Pe.mass,stiffness:r,damping:o}}else{const n=bh(e);t={...t,...n,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function Ds(e=Pe.visualDuration,t=Pe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:f,velocity:d,isResolvedFromDuration:p}=Th({...n,velocity:-nt(n.velocity||0)}),m=d||0,g=l/(2*Math.sqrt(c*u)),x=i-o,y=nt(Math.sqrt(c/u)),v=Math.abs(x)<5;s||(s=v?Pe.restSpeed.granular:Pe.restSpeed.default),r||(r=v?Pe.restDelta.granular:Pe.restDelta.default);let R;if(g<1){const b=Yr(y,g);R=T=>{const E=Math.exp(-g*y*T);return i-E*((m+g*y*x)/b*Math.sin(b*T)+x*Math.cos(b*T))}}else if(g===1)R=b=>i-Math.exp(-y*b)*(x+(m+y*x)*b);else{const b=y*Math.sqrt(g*g-1);R=T=>{const E=Math.exp(-g*y*T),S=Math.min(b*T,300);return i-E*((m+g*y*x)*Math.sinh(S)+b*x*Math.cosh(S))/b}}const w={calculatedDuration:p&&f||null,next:b=>{const T=R(b);if(p)a.done=b>=f;else{let E=b===0?m:0;g<1&&(E=b===0?Tt(m):bl(R,b,T));const S=Math.abs(E)<=s,O=Math.abs(i-T)<=r;a.done=S&&O}return a.value=a.done?i:T,a},toString:()=>{const b=Math.min(Uo(w),Is),T=vl(E=>w.next(b*E).value,b,30);return b+"ms "+T},toTransition:()=>{}};return w}Ds.applyToOptions=e=>{const t=yh(e,100,Ds);return e.ease=t.ease,e.duration=Tt(t.duration),e.type="keyframes",e};function Gr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},p=S=>a!==void 0&&S<a||c!==void 0&&S>c,m=S=>a===void 0?c:c===void 0||Math.abs(a-S)<Math.abs(c-S)?a:c;let g=n*t;const x=f+g,y=i===void 0?x:i(x);y!==x&&(g=y-f);const v=S=>-g*Math.exp(-S/s),R=S=>y+v(S),w=S=>{const O=v(S),A=R(S);d.done=Math.abs(O)<=l,d.value=d.done?y:A};let b,T;const E=S=>{p(d.value)&&(b=S,T=Ds({keyframes:[d.value,m(d.value)],velocity:bl(R,S,d.value),damping:r,stiffness:o,restDelta:l,restSpeed:u}))};return E(0),{calculatedDuration:null,next:S=>{let O=!1;return!T&&b===void 0&&(O=!0,w(S),E(S)),b!==void 0&&S>=b?T.next(S-b):(!O&&w(S),d)}}}function Eh(e,t,n){const s=[],r=n||Et.mix||yl,o=e.length-1;for(let i=0;i<o;i++){let a=r(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||ot:t;a=Yn(c,a)}s.push(a)}return s}function Ch(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const o=e.length;if(Io(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Eh(t,s,r),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Un(e[f],e[f+1],u);return a[f](d)};return n?u=>l(vt(e[0],e[o-1],u)):l}function Ph(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Un(0,t,s);e.push(Ee(n,1,r))}}function Mh(e){const t=[0];return Ph(t,e.length-1),t}function Oh(e,t){return e.map(n=>n*t)}function Ah(e,t){return e.map(()=>t||il).splice(0,e.length-1)}function Ln({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Wd(s)?s.map(_i):_i(s),o={done:!1,value:t[0]},i=Oh(n&&n.length===t.length?n:Mh(t),e),a=Ch(i,t,{ease:Array.isArray(r)?r:Ah(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const Ih=e=>e!==null;function Wo(e,{repeat:t,repeatType:n="loop"},s,r=1){const o=e.filter(Ih),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Dh={decay:Gr,inertia:Gr,tween:Ln,keyframes:Ln,spring:Ds};function xl(e){typeof e.type=="string"&&(e.type=Dh[e.type])}class Ho{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const kh=e=>e/100;class $o extends Ho{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==$e.now()&&this.tick($e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;xl(t);const{type:n=Ln,repeat:s=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Ln;c!==Ln&&typeof a[0]!="number"&&(this.mixKeyframes=Yn(kh,yl(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=Uo(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let R=this.currentTime,w=s;if(f){const S=Math.min(this.currentTime,r)/a;let O=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&O--,O=Math.min(O,f+1),O%2&&(d==="reverse"?(A=1-A,p&&(A-=p/a)):d==="mirror"&&(w=i)),R=vt(0,1,A)*a}const b=v?{done:!1,value:u[0]}:w.next(R);o&&(b.value=o(b.value));let{done:T}=b;!v&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return E&&m!==Gr&&(b.value=Wo(u,this.options,x,this.speed)),g&&g(b.value),E&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return nt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nt(t)}get time(){return nt(this.currentTime)}set time(t){t=Tt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime($e.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=nt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=gh,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),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($e.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(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Lh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Gt=e=>e*180/Math.PI,zr=e=>{const t=Gt(Math.atan2(e[1],e[0]));return Xr(t)},Vh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zr,rotateZ:zr,skewX:e=>Gt(Math.atan(e[1])),skewY:e=>Gt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Xr=e=>(e=e%360,e<0&&(e+=360),e),Zi=zr,Ji=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ea=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Fh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ji,scaleY:ea,scale:e=>(Ji(e)+ea(e))/2,rotateX:e=>Xr(Gt(Math.atan2(e[6],e[5]))),rotateY:e=>Xr(Gt(Math.atan2(-e[2],e[0]))),rotateZ:Zi,rotate:Zi,skewX:e=>Gt(Math.atan(e[4])),skewY:e=>Gt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qr(e){return e.includes("scale")?1:0}function Qr(e,t){if(!e||e==="none")return qr(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Fh,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Vh,r=a}if(!r)return qr(t);const o=s[t],i=r[1].split(",").map(Bh);return typeof o=="function"?o(i):i[o]}const Nh=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Qr(n,t)};function Bh(e){return parseFloat(e.trim())}const Rn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wn=new Set(Rn),ta=e=>e===xn||e===_,jh=new Set(["x","y","z"]),Uh=Rn.filter(e=>!jh.has(e));function Wh(e){const t=[];return Uh.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const At={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Qr(t,"x"),y:(e,{transform:t})=>Qr(t,"y")};At.translateX=At.x;At.translateY=At.y;const Xt=new Set;let Zr=!1,Jr=!1,eo=!1;function Rl(){if(Jr){const e=Array.from(Xt).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Wh(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([o,i])=>{s.getValue(o)?.set(i)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Jr=!1,Zr=!1,Xt.forEach(e=>e.complete(eo)),Xt.clear()}function wl(){Xt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Jr=!0)})}function Hh(){eo=!0,wl(),Rl(),eo=!1}class Ko{constructor(t,n,s,r,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Xt.add(this),Zr||(Zr=!0,Re.read(wl),Re.resolveKeyframes(Rl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const o=r?.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const a=s.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),r&&o===void 0&&r.set(t[0])}Lh(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xt.delete(this)}cancel(){this.state==="scheduled"&&(Xt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const $h=e=>e.startsWith("--");function Kh(e,t,n){$h(t)?e.style.setProperty(t,n):e.style[t]=n}const _h=Do(()=>window.ScrollTimeline!==void 0),Yh={};function Gh(e,t){const n=Do(e);return()=>Yh[t]??n()}const Sl=Gh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),On=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,na={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:On([0,.65,.55,1]),circOut:On([.55,0,1,.45]),backIn:On([.31,.01,.66,-.59]),backOut:On([.33,1.53,.69,.99])};function Tl(e,t){if(e)return typeof e=="function"?Sl()?vl(e,t):"ease-out":al(e)?On(e):Array.isArray(e)?e.map(n=>Tl(n,t)||na.easeOut):na[e]}function zh(e,t,n,{delay:s=0,duration:r=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const f=Tl(a,r);Array.isArray(f)&&(u.easing=f);const d={delay:s,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),e.animate(u,d)}function El(e){return typeof e=="function"&&"applyToOptions"in e}function Xh({type:e,...t}){return El(e)&&Sl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class qh extends Ho{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,Io(typeof t.type!="string");const l=Xh(t);this.animation=zh(n,s,r,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=Wo(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Kh(n,s,u),this.animation.cancel()}c?.(),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:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return nt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+nt(t)}get time(){return nt(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Tt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&_h()?(this.animation.timeline=t,ot):n(this)}}const Cl={anticipate:sl,backInOut:nl,circInOut:ol};function Qh(e){return e in Cl}function Zh(e){typeof e.ease=="string"&&Qh(e.ease)&&(e.ease=Cl[e.ease])}const Rr=10;class Jh extends qh{constructor(t){Zh(t),xl(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new $o({...i,autoplay:!1}),c=Math.max(Rr,$e.now()-this.startTime),l=vt(0,Rr,c-Rr);n.setWithVelocity(a.sample(Math.max(0,c-l)).value,a.sample(c).value,l),a.stop()}}const sa=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nt.test(e)||e==="0")&&!e.startsWith("url("));function ep(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tp(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=sa(r,t),a=sa(o,t);return!i||!a?!1:ep(e)||(n==="spring"||El(n))&&s}function to(e){e.duration=0,e.type="keyframes"}const np=new Set(["opacity","clipPath","filter","transform"]),sp=Do(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function rp(e){const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:o,type:i}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return sp()&&n&&np.has(n)&&(n!=="transform"||!l)&&!c&&!s&&r!=="mirror"&&o!==0&&i!=="inertia"}const op=40;class ip extends Ho{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=$e.now();const d={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:o,repeatType:i,name:c,motionValue:l,element:u,...f},p=u?.KeyframeResolver||Ko;this.keyframeResolver=new p(a,(m,g,x)=>this.onKeyframesResolved(m,g,d,!x),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=$e.now(),tp(t,o,i,a)||((Et.instantAnimations||!c)&&u?.(Wo(t,s,n)),t[0]=t[t.length-1],to(s),s.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>op?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},p=!l&&rp(d),m=d.motionValue?.owner?.current,g=p?new Jh({...d,element:m}):new $o(d);g.finished.then(()=>{this.notifyFinished()}).catch(ot),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hh()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Pl(e,t,n,s=0,r=1){const o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),i=e.size,a=(i-1)*s;return typeof n=="function"?n(o,i):r===1?o*s:a-o*s}const ap=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cp(e){const t=ap.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}function Ml(e,t,n=1){const[s,r]=cp(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const i=o.trim();return zc(i)?parseFloat(i):i}return Fo(r)?Ml(r,t,n+1):r}const lp={type:"spring",stiffness:500,damping:25,restSpeed:10},up=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fp={type:"keyframes",duration:.8},dp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hp=(e,{keyframes:t})=>t.length>2?fp:wn.has(e)?e.startsWith("scale")?up(t[1]):lp:dp,pp=e=>e!==null;function mp(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(pp),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function _o(e,t){return e?.[t]??e?.default??e}function gp({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:o,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Yo=(e,t,n,s={},r,o)=>i=>{const a=_o(s,e)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-Tt(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};gp(a)||Object.assign(u,hp(e,u)),u.duration&&(u.duration=Tt(u.duration)),u.repeatDelay&&(u.repeatDelay=Tt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(to(u),u.delay===0&&(f=!0)),(Et.instantAnimations||Et.skipAnimations)&&(f=!0,to(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const d=mp(u.keyframes,a);if(d!==void 0){Re.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new $o(u):new ip(u)};function ra(e){const t=[{},{}];return e?.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Go(e,t,n,s){if(typeof t=="function"){const[r,o]=ra(s);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=ra(s);t=t(n!==void 0?n:e.custom,r,o)}return t}function ln(e,t,n){const s=e.getProps();return Go(s,t,n!==void 0?n:s.custom,e)}const Ol=new Set(["width","height","top","left","right","bottom",...Rn]),oa=30,yp=e=>!isNaN(parseFloat(e));class vp{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const r=$e.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=$e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=yp(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ko);const s=this.events[t].add(n);return t==="change"?()=>{s(),Re.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>oa)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,oa);return Qc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 pn(e,t){return new vp(e,t)}const no=e=>Array.isArray(e);function bp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,pn(n))}function xp(e){return no(e)?e[e.length-1]||0:e}function Rp(e,t){const n=ln(e,t);let{transitionEnd:s={},transition:r={},...o}=n||{};o={...o,...s};for(const i in o){const a=xp(o[i]);bp(e,i,a)}}const He=e=>!!(e&&e.getVelocity);function wp(e){return!!(He(e)&&e.add)}function so(e,t){const n=e.getValue("willChange");if(wp(n))return n.add(t);if(!n&&Et.WillChange){const s=new Et.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function zo(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Sp="framerAppearId",Al="data-"+zo(Sp);function Il(e){return e.props[Al]}function Tp({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Dl(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:i,...a}=t;const c=o?.reduceMotion;s&&(o=s);const l=[],u=r&&e.animationState&&e.animationState.getState()[r];for(const f in a){const d=e.getValue(f,e.latestValues[f]??null),p=a[f];if(p===void 0||u&&Tp(u,f))continue;const m={delay:n,..._o(o||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===g&&!m.velocity)continue;let x=!1;if(window.MotionHandoffAnimation){const R=Il(e);if(R){const w=window.MotionHandoffAnimation(R,f,Re);w!==null&&(m.startTime=w,x=!0)}}so(e,f);const y=c??e.shouldReduceMotion;d.start(Yo(f,d,p,y&&Ol.has(f)?{type:!1}:m,e,x));const v=d.animation;v&&l.push(v)}return i&&Promise.all(l).then(()=>{Re.update(()=>{i&&Rp(e,i)})}),l}function ro(e,t,n={}){const s=ln(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const o=s?()=>Promise.all(Dl(e,s,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:f}=r;return Ep(e,t,c,l,u,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[c,l]=a==="beforeChildren"?[o,i]:[i,o];return c().then(()=>l())}else return Promise.all([o(),i(n.delay)])}function Ep(e,t,n=0,s=0,r=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(ro(c,t,{...i,delay:n+(typeof s=="function"?0:s)+Pl(e.variantChildren,c,s,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Cp(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(o=>ro(e,o,n));s=Promise.all(r)}else if(typeof t=="string")s=ro(e,t,n);else{const r=typeof t=="function"?ln(e,t,n.custom):t;s=Promise.all(Dl(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Pp={test:e=>e==="auto",parse:e=>e},kl=e=>t=>t.test(e),Ll=[xn,_,pt,Ot,eh,Jd,Pp],ia=e=>Ll.find(kl(e));function Mp(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qc(e):!0}const Op=new Set(["brightness","contrast","saturate","opacity"]);function Ap(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(No)||[];if(!s)return e;const r=n.replace(s,"");let o=Op.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+r+")"}const Ip=/\b([a-z-]*)\(.*?\)/gu,oo={...Nt,getAnimatableNone:e=>{const t=e.match(Ip);return t?t.map(Ap).join(" "):e}},aa={...xn,transform:Math.round},Dp={rotate:Ot,rotateX:Ot,rotateY:Ot,rotateZ:Ot,scale:ns,scaleX:ns,scaleY:ns,scaleZ:ns,skew:Ot,skewX:Ot,skewY:Ot,distance:_,translateX:_,translateY:_,translateZ:_,x:_,y:_,z:_,perspective:_,transformPerspective:_,opacity:Wn,originX:Gi,originY:Gi,originZ:_},Xo={borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,top:_,right:_,bottom:_,left:_,inset:_,insetBlock:_,insetBlockStart:_,insetBlockEnd:_,insetInline:_,insetInlineStart:_,insetInlineEnd:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,paddingBlock:_,paddingBlockStart:_,paddingBlockEnd:_,paddingInline:_,paddingInlineStart:_,paddingInlineEnd:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,marginBlock:_,marginBlockStart:_,marginBlockEnd:_,marginInline:_,marginInlineStart:_,marginInlineEnd:_,fontSize:_,backgroundPositionX:_,backgroundPositionY:_,...Dp,zIndex:aa,fillOpacity:Wn,strokeOpacity:Wn,numOctaves:aa},kp={...Xo,color:Oe,backgroundColor:Oe,outlineColor:Oe,fill:Oe,stroke:Oe,borderColor:Oe,borderTopColor:Oe,borderRightColor:Oe,borderBottomColor:Oe,borderLeftColor:Oe,filter:oo,WebkitFilter:oo},Vl=e=>kp[e];function Fl(e,t){let n=Vl(e);return n!==oo&&(n=Nt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Lp=new Set(["auto","none","0"]);function Vp(e,t,n){let s=0,r;for(;s<e.length&&!r;){const o=e[s];typeof o=="string"&&!Lp.has(o)&&Hn(o).values.length&&(r=e[s]),s++}if(r&&n)for(const o of t)e[o]=Fl(n,r)}class Fp extends Ko{constructor(t,n,s,r,o){super(t,n,s,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let f=t[u];if(typeof f=="string"&&(f=f.trim(),Fo(f))){const d=Ml(f,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Ol.has(s)||t.length!==2)return;const[r,o]=t,i=ia(r),a=ia(o),c=Yi(r),l=Yi(o);if(c!==l&&At[s]){this.needsMeasurement=!0;return}if(i!==a)if(ta(i)&&ta(a))for(let u=0;u<t.length;u++){const f=t[u];typeof f=="string"&&(t[u]=parseFloat(f))}else At[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Mp(t[r]))&&s.push(r);s.length&&Vp(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=At[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,i=s[o];s[o]=At[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Np(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=n?.[e]??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const Nl=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function io(e){return Xc(e)&&"offsetHeight"in e}const{schedule:qo}=cl(queueMicrotask,!1),ut={x:!1,y:!1};function Bl(){return ut.x||ut.y}function Bp(e){return e==="x"||e==="y"?ut[e]?null:(ut[e]=!0,()=>{ut[e]=!1}):ut.x||ut.y?null:(ut.x=ut.y=!0,()=>{ut.x=ut.y=!1})}function jl(e,t){const n=Np(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function ca(e){return!(e.pointerType==="touch"||Bl())}function jp(e,t,n={}){const[s,r,o]=jl(e,n),i=a=>{if(!ca(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=f=>{ca(f)&&(l(f),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,r)};return s.forEach(a=>{a.addEventListener("pointerenter",i,r)}),o}const Ul=(e,t)=>t?e===t?!0:Ul(e,t.parentElement):!1,Qo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Up=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Wl(e){return Up.has(e.tagName)||e.isContentEditable===!0}const gs=new WeakSet;function la(e){return t=>{t.key==="Enter"&&e(t)}}function wr(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Wp=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=la(()=>{if(gs.has(n))return;wr(n,"down");const r=la(()=>{wr(n,"up")}),o=()=>wr(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function ua(e){return Qo(e)&&!Bl()}function Hp(e,t,n={}){const[s,r,o]=jl(e,n),i=a=>{const c=a.currentTarget;if(!ua(a))return;gs.add(c);const l=t(c,a),u=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),gs.has(c)&&gs.delete(c),ua(p)&&typeof l=="function"&&l(p,{success:m})},f=p=>{u(p,c===window||c===document||n.useGlobalTarget||Ul(c,p.target))},d=p=>{u(p,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",d,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,r),io(a)&&(a.addEventListener("focus",l=>Wp(l,r)),!Wl(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Hl(e){return Xc(e)&&"ownerSVGElement"in e}function $p(e){return Hl(e)&&e.tagName==="svg"}const Kp=[...Ll,Oe,Nt],_p=e=>Kp.find(kl(e)),fa=()=>({translate:0,scale:1,origin:0,originPoint:0}),rn=()=>({x:fa(),y:fa()}),da=()=>({min:0,max:0}),De=()=>({x:da(),y:da()}),ao={current:null},$l={current:!1},Yp=typeof window<"u";function Gp(){if($l.current=!0,!!Yp)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ao.current=e.matches;e.addEventListener("change",t),t()}else ao.current=!1}const zp=new WeakMap;function Xs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $n(e){return typeof e=="string"||Array.isArray(e)}const Zo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jo=["initial",...Zo];function qs(e){return Xs(e.animate)||Jo.some(t=>$n(e[t]))}function Kl(e){return!!(qs(e)||e.variants)}function Xp(e,t,n){for(const s in t){const r=t[s],o=n[s];if(He(r))e.addValue(s,r);else if(He(o))e.addValue(s,pn(r,{owner:e}));else if(o!==r)if(e.hasValue(s)){const i=e.getValue(s);i.liveStyle===!0?i.jump(r):i.hasAnimated||i.set(r)}else{const i=e.getStaticValue(s);e.addValue(s,pn(i!==void 0?i:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const ha=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ks={};function _l(e){ks=e}function qp(){return ks}class Qp{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ko,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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 d=$e.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Re.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=qs(n),this.isVariantNode=Kl(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&He(p)&&p.set(c[d])}}mount(t){this.current=t,zp.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),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:($l.current||Gp(),this.shouldReduceMotion=ao.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ft(this.notifyUpdate),Ft(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=wn.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Re.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ks){const n=ks[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):De()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ha.length;s++){const r=ha[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,i=t[o];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=Xp(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=pn(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(zc(s)||qc(s))?s=parseFloat(s):!_p(s)&&Nt.test(n)&&(s=Fl(t,n)),this.setBaseTarget(t,He(s)?s.get():s)),He(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Go(this.props,n,this.presenceContext?.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!He(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ko),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){qo.render(this.render)}}class Yl extends Qp{constructor(){super(...arguments),this.KeyframeResolver=Fp}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;He(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Gl({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Zp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Jp(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Sr(e){return e===void 0||e===1}function co({scale:e,scaleX:t,scaleY:n}){return!Sr(e)||!Sr(t)||!Sr(n)}function _t(e){return co(e)||zl(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zl(e){return pa(e.x)||pa(e.y)}function pa(e){return e&&e!=="0%"}function Ls(e,t,n){const s=e-n,r=t*s;return n+r}function ma(e,t,n,s,r){return r!==void 0&&(e=Ls(e,r,s)),Ls(e,n,s)+t}function lo(e,t=0,n=1,s,r){e.min=ma(e.min,t,n,s,r),e.max=ma(e.max,t,n,s,r)}function Xl(e,{x:t,y:n}){lo(e.x,t.translate,t.scale,t.originPoint),lo(e.y,n.translate,n.scale,n.originPoint)}const ga=.999999999999,ya=1.0000000000001;function em(e,t,n,s=!1){const r=n.length;if(!r)return;t.x=t.y=1;let o,i;for(let a=0;a<r;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&an(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Xl(e,i)),s&&_t(o.latestValues)&&an(e,o.latestValues))}t.x<ya&&t.x>ga&&(t.x=1),t.y<ya&&t.y>ga&&(t.y=1)}function on(e,t){e.min=e.min+t,e.max=e.max+t}function va(e,t,n,s,r=.5){const o=Ee(e.min,e.max,r);lo(e,t,n,o,s)}function an(e,t){va(e.x,t.x,t.scaleX,t.scale,t.originX),va(e.y,t.y,t.scaleY,t.scale,t.originY)}function ql(e,t){return Gl(Jp(e.getBoundingClientRect(),t))}function tm(e,t,n){const s=ql(e,n),{scroll:r}=t;return r&&(on(s.x,r.offset.x),on(s.y,r.offset.y)),s}const nm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sm=Rn.length;function rm(e,t,n){let s="",r=!0;for(let o=0;o<sm;o++){const i=Rn[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const l=parseFloat(a);c=i.startsWith("scale")?l===1:l===0}if(!c||n){const l=Nl(a,Xo[i]);if(!c){r=!1;const u=nm[i]||i;s+=`${u}(${l}) `}n&&(t[i]=l)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function ei(e,t,n){const{style:s,vars:r,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(wn.has(c)){i=!0;continue}else if(ul(c)){r[c]=l;continue}else{const u=Nl(l,Xo[c]);c.startsWith("origin")?(a=!0,o[c]=u):s[c]=u}}if(t.transform||(i||n?s.transform=rm(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;s.transformOrigin=`${c} ${l} ${u}`}}function Ql(e,{style:t,vars:n},s,r){const o=e.style;let i;for(i in t)o[i]=t[i];r?.applyProjectionStyles(o,s);for(i in n)o.setProperty(i,n[i])}function ba(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Pn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_.test(e))e=parseFloat(e);else return e;const n=ba(e,t.target.x),s=ba(e,t.target.y);return`${n}% ${s}%`}},om={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=Nt.parse(e);if(r.length>5)return s;const o=Nt.createTransformer(e),i=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+i]/=a,r[1+i]/=c;const l=Ee(a,c,.5);return typeof r[2+i]=="number"&&(r[2+i]/=l),typeof r[3+i]=="number"&&(r[3+i]/=l),o(r)}},uo={borderRadius:{...Pn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pn,borderTopRightRadius:Pn,borderBottomLeftRadius:Pn,borderBottomRightRadius:Pn,boxShadow:om};function Zl(e,{layout:t,layoutId:n}){return wn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!uo[e]||e==="opacity")}function ti(e,t,n){const s=e.style,r=t?.style,o={};if(!s)return o;for(const i in s)(He(s[i])||r&&He(r[i])||Zl(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=s[i]);return o}function im(e){return window.getComputedStyle(e)}class am extends Yl{constructor(){super(...arguments),this.type="html",this.renderInstance=Ql}readValueFromInstance(t,n){if(wn.has(n))return this.projection?.isProjecting?qr(n):Nh(t,n);{const s=im(t),r=(ul(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ql(t,n)}build(t,n,s){ei(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return ti(t,n,s)}}const cm={offset:"stroke-dashoffset",array:"stroke-dasharray"},lm={offset:"strokeDashoffset",array:"strokeDasharray"};function um(e,t,n=1,s=0,r=!0){e.pathLength=1;const o=r?cm:lm;e[o.offset]=`${-s}`,e[o.array]=`${t} ${n}`}const fm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Jl(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:o=1,pathOffset:i=0,...a},c,l,u){if(ei(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox);for(const p of fm)f[p]!==void 0&&(d[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),r!==void 0&&um(f,r,o,i,!1)}const eu=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"]),tu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dm(e,t,n,s){Ql(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(eu.has(r)?r:zo(r),t.attrs[r])}function nu(e,t,n){const s=ti(e,t,n);for(const r in e)if(He(e[r])||He(t[r])){const o=Rn.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[o]=e[r]}return s}class hm extends Yl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=De}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wn.has(n)){const s=Vl(n);return s&&s.default||0}return n=eu.has(n)?n:zo(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return nu(t,n,s)}build(t,n,s){Jl(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){dm(t,n,s,r)}mount(t){this.isSVGTag=tu(t.tagName),super.mount(t)}}const pm=Jo.length;function su(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?su(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pm;n++){const s=Jo[n],r=e.props[s];($n(r)||r===!1)&&(t[s]=r)}return t}function ru(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const mm=[...Zo].reverse(),gm=Zo.length;function ym(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Cp(e,n,s)))}function vm(e){let t=ym(e),n=xa(),s=!0;const r=c=>(l,u)=>{const f=ln(e,u,c==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(c){t=c(e)}function i(c){const{props:l}=e,u=su(e.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let x=0;x<gm;x++){const y=mm[x],v=n[y],R=l[y]!==void 0?l[y]:u[y],w=$n(R),b=y===c?v.isActive:null;b===!1&&(m=x);let T=R===u[y]&&R!==l[y]&&w;if(T&&s&&e.manuallyAnimateOnMount&&(T=!1),v.protectedKeys={...p},!v.isActive&&b===null||!R&&!v.prevProp||Xs(R)||typeof R=="boolean")continue;const E=bm(v.prevProp,R);let S=E||y===c&&v.isActive&&!T&&w||x>m&&w,O=!1;const A=Array.isArray(R)?R:[R];let L=A.reduce(r(y),{});b===!1&&(L={});const{prevResolvedValues:I={}}=v,C={...I,...L},N=k=>{S=!0,d.has(k)&&(O=!0,d.delete(k)),v.needsAnimating[k]=!0;const P=e.getValue(k);P&&(P.liveStyle=!1)};for(const k in C){const P=L[k],B=I[k];if(p.hasOwnProperty(k))continue;let V=!1;no(P)&&no(B)?V=!ru(P,B):V=P!==B,V?P!=null?N(k):d.add(k):P!==void 0&&d.has(k)?N(k):v.protectedKeys[k]=!0}v.prevProp=R,v.prevResolvedValues=L,v.isActive&&(p={...p,...L}),s&&e.blockInitialAnimation&&(S=!1);const D=T&&E;S&&(!D||O)&&f.push(...A.map(k=>{const P={type:y};if(typeof k=="string"&&s&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,V=ln(B,k);if(B.enteringChildren&&V){const{delayChildren:Y}=V.transition||{};P.delay=Pl(B.enteringChildren,e,Y)}}return{animation:k,options:P}}))}if(d.size){const x={};if(typeof l.initial!="boolean"){const y=ln(e,Array.isArray(l.initial)?l.initial[0]:l.initial);y&&y.transition&&(x.transition=y.transition)}d.forEach(y=>{const v=e.getBaseTarget(y),R=e.getValue(y);R&&(R.liveStyle=!0),x[y]=v??null}),f.push({animation:x})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),s=!1,g?t(f):Promise.resolve()}function a(c,l){if(n[c].isActive===l)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(c,l)),n[c].isActive=l;const u=i(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=xa()}}}function bm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ru(t,e):!1}function Kt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xa(){return{animate:Kt(!0),whileInView:Kt(),whileHover:Kt(),whileTap:Kt(),whileDrag:Kt(),whileFocus:Kt(),exit:Kt()}}function Ra(e,t){e.min=t.min,e.max=t.max}function ct(e,t){Ra(e.x,t.x),Ra(e.y,t.y)}function wa(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const ou=1e-4,xm=1-ou,Rm=1+ou,iu=.01,wm=0-iu,Sm=0+iu;function Ke(e){return e.max-e.min}function Tm(e,t,n){return Math.abs(e-t)<=n}function Sa(e,t,n,s=.5){e.origin=s,e.originPoint=Ee(t.min,t.max,e.origin),e.scale=Ke(n)/Ke(t),e.translate=Ee(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xm&&e.scale<=Rm||isNaN(e.scale))&&(e.scale=1),(e.translate>=wm&&e.translate<=Sm||isNaN(e.translate))&&(e.translate=0)}function Vn(e,t,n,s){Sa(e.x,t.x,n.x,s?s.originX:void 0),Sa(e.y,t.y,n.y,s?s.originY:void 0)}function Ta(e,t,n){e.min=n.min+t.min,e.max=e.min+Ke(t)}function Em(e,t,n){Ta(e.x,t.x,n.x),Ta(e.y,t.y,n.y)}function Ea(e,t,n){e.min=t.min-n.min,e.max=e.min+Ke(t)}function Vs(e,t,n){Ea(e.x,t.x,n.x),Ea(e.y,t.y,n.y)}function Ca(e,t,n,s,r){return e-=t,e=Ls(e,1/n,s),r!==void 0&&(e=Ls(e,1/r,s)),e}function Cm(e,t=0,n=1,s=.5,r,o=e,i=e){if(pt.test(t)&&(t=parseFloat(t),t=Ee(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Ee(o.min,o.max,s);e===o&&(a-=t),e.min=Ca(e.min,t,n,a,r),e.max=Ca(e.max,t,n,a,r)}function Pa(e,t,[n,s,r],o,i){Cm(e,t[n],t[s],t[r],t.scale,o,i)}const Pm=["x","scaleX","originX"],Mm=["y","scaleY","originY"];function Ma(e,t,n,s){Pa(e.x,t,Pm,n?n.x:void 0,s?s.x:void 0),Pa(e.y,t,Mm,n?n.y:void 0,s?s.y:void 0)}function Oa(e){return e.translate===0&&e.scale===1}function au(e){return Oa(e.x)&&Oa(e.y)}function Aa(e,t){return e.min===t.min&&e.max===t.max}function Om(e,t){return Aa(e.x,t.x)&&Aa(e.y,t.y)}function Ia(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function cu(e,t){return Ia(e.x,t.x)&&Ia(e.y,t.y)}function Da(e){return Ke(e.x)/Ke(e.y)}function ka(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function tt(e){return[e("x"),e("y")]}function Am(e,t,n){let s="";const r=e.x.translate/t.x,o=e.y.translate/t.y,i=n?.z||0;if((r||o||i)&&(s=`translate3d(${r}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:f,rotateY:d,skewX:p,skewY:m}=n;l&&(s=`perspective(${l}px) ${s}`),u&&(s+=`rotate(${u}deg) `),f&&(s+=`rotateX(${f}deg) `),d&&(s+=`rotateY(${d}deg) `),p&&(s+=`skewX(${p}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const lu=["TopLeft","TopRight","BottomLeft","BottomRight"],Im=lu.length,La=e=>typeof e=="string"?parseFloat(e):e,Va=e=>typeof e=="number"||_.test(e);function Dm(e,t,n,s,r,o){r?(e.opacity=Ee(0,n.opacity??1,km(s)),e.opacityExit=Ee(t.opacity??1,0,Lm(s))):o&&(e.opacity=Ee(t.opacity??1,n.opacity??1,s));for(let i=0;i<Im;i++){const a=`border${lu[i]}Radius`;let c=Fa(t,a),l=Fa(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Va(c)===Va(l)?(e[a]=Math.max(Ee(La(c),La(l),s),0),(pt.test(l)||pt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=Ee(t.rotate||0,n.rotate||0,s))}function Fa(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const km=uu(0,.5,rl),Lm=uu(.5,.95,ot);function uu(e,t,n){return s=>s<e?0:s>t?1:n(Un(e,t,s))}function Vm(e,t,n){const s=He(e)?e:pn(e);return s.start(Yo("",s,t,n)),s.animation}function Kn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const Fm=(e,t)=>e.depth-t.depth;class Nm{constructor(){this.children=[],this.isDirty=!1}add(t){Oo(this.children,t),this.isDirty=!0}remove(t){Ao(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Fm),this.isDirty=!1,this.children.forEach(t)}}function Bm(e,t){const n=$e.now(),s=({timestamp:r})=>{const o=r-n;o>=t&&(Ft(s),e(o-t))};return Re.setup(s,!0),()=>Ft(s)}function ys(e){return He(e)?e.get():e}class jm{constructor(){this.members=[]}add(t){Oo(this.members,t),t.scheduleRender()}remove(t){if(Ao(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let s;for(let r=n;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender();const r=s.options.layoutDependency,o=t.options.layoutDependency;r!==void 0&&o!==void 0&&r===o||(t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:a}=t.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tr=["","X","Y","Z"],Um=1e3;let Wm=0;function Er(e,t,n,s){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),s&&(s[e]=0))}function fu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Il(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Re,!(r||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&fu(s)}function du({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(i={},a=t?.()){this.id=Wm++,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(Km),this.nodes.forEach(zm),this.nodes.forEach(Xm),this.nodes.forEach(_m)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Nm)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ko),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Hl(i)&&!$p(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Re.read(()=>{f=window.innerWidth}),e(i,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,u&&u(),u=Bm(d,250),vs.hasAnimatedSinceResize&&(vs.hasAnimatedSinceResize=!1,this.nodes.forEach(ja)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||eg,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=l.getProps(),y=!this.targetLayout||!cu(this.targetLayout,p),v=!f&&d;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={..._o(m,"layout"),onPlay:g,onComplete:x};(l.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(u,v)}else f||ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ft(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(qm),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Na);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ba);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Gm),this.nodes.forEach(Hm),this.nodes.forEach($m)):this.nodes.forEach(Ba),this.clearAllSnapshots();const a=$e.now();Ve.delta=vt(0,1e3/60,a-Ve.timestamp),Ve.timestamp=a,Ve.isProcessing=!0,gr.update.process(Ve),gr.preRender.process(Ve),gr.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ym),this.sharedNodes.forEach(Qm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Re.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Re.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ke(this.snapshot.measuredBox.x)&&!Ke(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=De(),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,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!au(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||_t(this.latestValues)||u)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),tg(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:i}=this.options;if(!i)return De();const a=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ng))){const{scroll:l}=this.root;l&&(on(a.x,l.offset.x),on(a.y,l.offset.y))}return a}removeElementScroll(i){const a=De();if(ct(a,i),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:f}=l;l!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&ct(a,i),on(a.x,u.offset.x),on(a.y,u.offset.y))}return a}applyTransform(i,a=!1){const c=De();ct(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&an(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),_t(u.latestValues)&&an(c,u.latestValues)}return _t(this.latestValues)&&an(c,this.latestValues),c}removeTransform(i){const a=De();ct(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!_t(l.latestValues))continue;co(l.latestValues)&&l.updateSnapshot();const u=De(),f=l.measurePageBox();ct(u,f),Ma(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return _t(this.latestValues)&&Ma(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==Ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=Ve.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=De(),this.targetWithTransforms=De()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Em(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ct(this.target,this.layout.layoutBox),Xl(this.target,this.targetDelta)):ct(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||co(this.parent.latestValues)||zl(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=De(),this.relativeTargetOrigin=De(),Vs(this.relativeTargetOrigin,a,c),ct(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=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||u))return;ct(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;em(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=De());const{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wa(this.prevProjectionDelta.x,this.projectionDelta.x),wa(this.prevProjectionDelta.y,this.projectionDelta.y)),Vn(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!ka(this.projectionDelta.x,this.prevProjectionDelta.x)||!ka(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rn(),this.projectionDelta=rn(),this.projectionDeltaWithTransform=rn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},f=rn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=De(),p=c?c.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,x=this.getStack(),y=!x||x.members.length<=1,v=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(Jm));this.animationProgress=0;let R;this.mixTargetDelta=w=>{const b=w/1e3;Ua(f.x,i.x,b),Ua(f.y,i.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vs(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Zm(this.relativeTarget,this.relativeTargetOrigin,d,b),R&&Om(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=De()),ct(R,this.relativeTarget)),g&&(this.animationValues=u,Dm(u,l,this.latestValues,b,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ft(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Re.update(()=>{vs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pn(0)),this.currentAnimation=Vm(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.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 i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Um),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&hu(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||De();const f=Ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const d=Ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+d}ct(a,c),an(a,u),Vn(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new jm),this.sharedNodes.get(i).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 i=this.getStack();return i?i.lead===this:!0}getLead(){const{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Er("z",i,l,this.animationValues);for(let u=0;u<Tr.length;u++)Er(`rotate${Tr[u]}`,i,l,this.animationValues),Er(`skew${Tr[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=ys(a?.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=ys(a?.pointerEvents)||""),this.hasProjected&&!_t(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=Am(this.projectionDeltaWithTransform,this.treeScale,u);c&&(f=c(u,f)),i.transform=f;const{x:d,y:p}=this.projectionDelta;i.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,l.animationValues?i.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:i.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in uo){if(u[m]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:y}=uo[m],v=f==="none"?u[m]:g(u[m],l);if(x){const R=x.length;for(let w=0;w<R;w++)i[x[w]]=v}else y?this.options.visualElement.renderState.vars[m]=v:i[m]=v}this.options.layoutId&&(i.pointerEvents=l===this?ys(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(Na),this.root.sharedNodes.clear()}}}function Hm(e){e.updateLayout()}function $m(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:r}=e.options,o=t.source!==e.layout.source;r==="size"?tt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],d=Ke(f);f.min=n[u].min,f.max=f.min+d}):hu(r,t.layoutBox,n)&&tt(u=>{const f=o?t.measuredBox[u]:t.layoutBox[u],d=Ke(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const i=rn();Vn(i,n,t.layoutBox);const a=rn();o?Vn(a,e.applyTransform(s,!0),t.measuredBox):Vn(a,n,t.layoutBox);const c=!au(i);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const p=De();Vs(p,t.layoutBox,f.layoutBox);const m=De();Vs(m,n,d.layoutBox),cu(p,m)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:i,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Km(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function _m(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ym(e){e.clearSnapshot()}function Na(e){e.clearMeasurements()}function Ba(e){e.isLayoutDirty=!1}function Gm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ja(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zm(e){e.resolveTargetDelta()}function Xm(e){e.calcProjection()}function qm(e){e.resetSkewAndRotation()}function Qm(e){e.removeLeadSnapshot()}function Ua(e,t,n){e.translate=Ee(t.translate,0,n),e.scale=Ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Wa(e,t,n,s){e.min=Ee(t.min,n.min,s),e.max=Ee(t.max,n.max,s)}function Zm(e,t,n,s){Wa(e.x,t.x,n.x,s),Wa(e.y,t.y,n.y,s)}function Jm(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eg={duration:.45,ease:[.4,0,.1,1]},Ha=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$a=Ha("applewebkit/")&&!Ha("chrome/")?Math.round:ot;function Ka(e){e.min=$a(e.min),e.max=$a(e.max)}function tg(e){Ka(e.x),Ka(e.y)}function hu(e,t,n){return e==="position"||e==="preserve-aspect"&&!Tm(Da(t),Da(n),.2)}function ng(e){return e!==e.root&&e.scroll?.wasRoot}const sg=du({attachResizeListener:(e,t)=>Kn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Cr={current:void 0},pu=du({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cr.current){const e=new sg({});e.mount(window),e.setOptions({layoutScroll:!0}),Cr.current=e}return Cr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ni=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function _a(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rg(...e){return t=>{let n=!1;const s=e.map(r=>{const o=_a(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():_a(e[r],null)}}}}function og(...e){return h.useCallback(rg(...e),e)}class ig extends h.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=n.offsetParent,r=io(s)&&s.offsetWidth||0,o=io(s)&&s.offsetHeight||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left,i.bottom=o-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}}function ag({children:e,isPresent:t,anchorX:n,anchorY:s,root:r}){const o=h.useId(),i=h.useRef(null),a=h.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=h.useContext(ni),l=e.props?.ref??e?.ref,u=og(i,l);return h.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:x}=a.current;if(t||!i.current||!f||!d)return;const y=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${x}`:`top: ${p}`;i.current.dataset.motionPopId=o;const R=document.createElement("style");c&&(R.nonce=c);const w=r??document.head;return w.appendChild(R),R.sheet&&R.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${f}px !important;
|
|
5
|
+
height: ${d}px !important;
|
|
6
|
+
${y}px !important;
|
|
7
|
+
${v}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{w.contains(R)&&w.removeChild(R)}},[t]),$.jsx(ig,{isPresent:t,childRef:i,sizeRef:a,children:h.cloneElement(e,{ref:u})})}const cg=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:l})=>{const u=Mo(lg),f=h.useId();let d=!0,p=h.useMemo(()=>(d=!1,{id:f,initial:t,isPresent:n,custom:r,onExitComplete:m=>{u.set(m,!0);for(const g of u.values())if(!g)return;s&&s()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,s]);return o&&d&&(p={...p}),h.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),h.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),i==="popLayout"&&(e=$.jsx(ag,{isPresent:n,anchorX:a,anchorY:c,root:l,children:e})),$.jsx(zs.Provider,{value:p,children:e})};function lg(){return new Map}function mu(e=!0){const t=h.useContext(zs);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,o=h.useId();h.useEffect(()=>{if(e)return r(o)},[e]);const i=h.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,i]:[!0]}const ss=e=>e.key||"";function Ya(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const iw=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:l})=>{const[u,f]=mu(i),d=h.useMemo(()=>Ya(e),[e]),p=i&&!u?[]:d.map(ss),m=h.useRef(!0),g=h.useRef(d),x=Mo(()=>new Map),y=h.useRef(new Set),[v,R]=h.useState(d),[w,b]=h.useState(d);Gc(()=>{m.current=!1,g.current=d;for(let S=0;S<w.length;S++){const O=ss(w[S]);p.includes(O)?(x.delete(O),y.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[w,p.length,p.join("-")]);const T=[];if(d!==v){let S=[...d];for(let O=0;O<w.length;O++){const A=w[O],L=ss(A);p.includes(L)||(S.splice(O,0,A),T.push(A))}return o==="wait"&&T.length&&(S=T),b(Ya(S)),R(d),null}const{forceRender:E}=h.useContext(Po);return $.jsx($.Fragment,{children:w.map(S=>{const O=ss(S),A=i&&!u?!1:d===w||p.includes(O),L=()=>{if(y.current.has(O))return;if(y.current.add(O),x.has(O))x.set(O,!0);else return;let I=!0;x.forEach(C=>{C||(I=!1)}),I&&(E?.(),b(g.current),i&&f?.(),s&&s())};return $.jsx(cg,{isPresent:A,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:l,onExitComplete:A?void 0:L,anchorX:a,anchorY:c,children:S},O)})})},gu=h.createContext({strict:!1}),Ga={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 za=!1;function ug(){if(za)return;const e={};for(const t in Ga)e[t]={isEnabled:n=>Ga[t].some(s=>!!n[s])};_l(e),za=!0}function yu(){return ug(),qp()}function fg(e){const t=yu();for(const n in e)t[n]={...t[n],...e[n]};_l(t)}const dg=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","ignoreStrict","viewport"]);function Fs(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dg.has(e)}let vu=e=>!Fs(e);function hg(e){typeof e=="function"&&(vu=t=>t.startsWith("on")?!Fs(t):e(t))}try{hg(require("@emotion/is-prop-valid").default)}catch{}function pg(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(vu(r)||n===!0&&Fs(r)||!t&&!Fs(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const Qs=h.createContext({});function mg(e,t){if(qs(e)){const{initial:n,animate:s}=e;return{initial:n===!1||$n(n)?n:void 0,animate:$n(s)?s:void 0}}return e.inherit!==!1?t:{}}function gg(e){const{initial:t,animate:n}=mg(e,h.useContext(Qs));return h.useMemo(()=>({initial:t,animate:n}),[Xa(t),Xa(n)])}function Xa(e){return Array.isArray(e)?e.join(" "):e}const si=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bu(e,t,n){for(const s in t)!He(t[s])&&!Zl(s,n)&&(e[s]=t[s])}function yg({transformTemplate:e},t){return h.useMemo(()=>{const n=si();return ei(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vg(e,t){const n=e.style||{},s={};return bu(s,n,e),Object.assign(s,yg(e,t)),s}function bg(e,t){const n={},s=vg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const xu=()=>({...si(),attrs:{}});function xg(e,t,n,s){const r=h.useMemo(()=>{const o=xu();return Jl(o,t,tu(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};bu(o,e.style,e),r.style={...o,...r.style}}return r}const Rg=["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 ri(e){return typeof e!="string"||e.includes("-")?!1:!!(Rg.indexOf(e)>-1||/[A-Z]/u.test(e))}function wg(e,t,n,{latestValues:s},r,o=!1,i){const c=(i??ri(e)?xg:bg)(t,s,r,e),l=pg(t,typeof e=="string",o),u=e!==h.Fragment?{...l,...c,ref:n}:{},{children:f}=t,d=h.useMemo(()=>He(f)?f.get():f,[f]);return h.createElement(e,{...u,children:d})}function Sg({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Tg(n,s,r,e),renderState:t()}}function Tg(e,t,n,s){const r={},o=s(e,{});for(const d in o)r[d]=ys(o[d]);let{initial:i,animate:a}=e;const c=qs(e),l=Kl(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!Xs(f)){const d=Array.isArray(f)?f:[f];for(let p=0;p<d.length;p++){const m=Go(e,d[p]);if(m){const{transitionEnd:g,transition:x,...y}=m;for(const v in y){let R=y[v];if(Array.isArray(R)){const w=u?R.length-1:0;R=R[w]}R!==null&&(r[v]=R)}for(const v in g)r[v]=g[v]}}}return r}const Ru=e=>(t,n)=>{const s=h.useContext(Qs),r=h.useContext(zs),o=()=>Sg(e,t,s,r);return n?o():Mo(o)},Eg=Ru({scrapeMotionValuesFromProps:ti,createRenderState:si}),Cg=Ru({scrapeMotionValuesFromProps:nu,createRenderState:xu}),Pg=Symbol.for("motionComponentSymbol");function Mg(e,t,n){const s=h.useRef(n);h.useInsertionEffect(()=>{s.current=n});const r=h.useRef(null);return h.useCallback(o=>{o&&e.onMount?.(o),t&&(o?t.mount(o):t.unmount());const i=s.current;if(typeof i=="function")if(o){const a=i(o);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o)},[t])}const wu=h.createContext({});function An(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Og(e,t,n,s,r,o){const{visualElement:i}=h.useContext(Qs),a=h.useContext(gu),c=h.useContext(zs),l=h.useContext(ni).reducedMotion,u=h.useRef(null),f=h.useRef(!1);s=s||a.renderer,!u.current&&s&&(u.current=s(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:o}),f.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));const d=u.current,p=h.useContext(wu);d&&!d.projection&&r&&(d.type==="html"||d.type==="svg")&&Ag(u.current,n,r,p);const m=h.useRef(!1);h.useInsertionEffect(()=>{d&&m.current&&d.update(n,c)});const g=n[Al],x=h.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Gc(()=>{f.current=!0,d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),x.current&&d.animationState&&d.animationState.animateChanges())}),h.useEffect(()=>{d&&(!x.current&&d.animationState&&d.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),x.current=!1),d.enteringChildren=void 0)}),d}function Ag(e,t,n,s){const{layoutId:r,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Su(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||a&&An(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:l})}function Su(e){if(e)return e.options.allowProjection!==!1?e.projection:Su(e.parent)}function Pr(e,{forwardMotionProps:t=!1,type:n}={},s,r){s&&fg(s);const o=n?n==="svg":ri(e),i=o?Cg:Eg;function a(l,u){let f;const d={...h.useContext(ni),...l,layoutId:Ig(l)},{isStatic:p}=d,m=gg(l),g=i(l,p);if(!p&&Yc){Dg();const x=kg(d);f=x.MeasureLayout,m.visualElement=Og(e,g,d,r,x.ProjectionNode,o)}return $.jsxs(Qs.Provider,{value:m,children:[f&&m.visualElement?$.jsx(f,{visualElement:m.visualElement,...d}):null,wg(e,l,Mg(g,m.visualElement,u),g,p,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=h.forwardRef(a);return c[Pg]=e,c}function Ig({layoutId:e}){const t=h.useContext(Po).id;return t&&e!==void 0?t+"-"+e:e}function Dg(e,t){h.useContext(gu).strict}function kg(e){const t=yu(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Lg(e,t){if(typeof Proxy>"u")return Pr;const n=new Map,s=(o,i)=>Pr(o,i,e,t),r=(o,i)=>s(o,i);return new Proxy(r,{get:(o,i)=>i==="create"?s:(n.has(i)||n.set(i,Pr(i,void 0,e,t)),n.get(i))})}const Vg=(e,t)=>t.isSVG??ri(e)?new hm(t):new am(t,{allowProjection:e!==h.Fragment});class Fg extends jt{constructor(t){super(t),t.animationState||(t.animationState=vm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Ng=0;class Bg extends jt{constructor(){super(...arguments),this.id=Ng++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const jg={animation:{Feature:Fg},exit:{Feature:Bg}};function Xn(e){return{point:{x:e.pageX,y:e.pageY}}}const Ug=e=>t=>Qo(t)&&e(t,Xn(t));function Fn(e,t,n,s){return Kn(e,t,Ug(n),s)}const Tu=({current:e})=>e?e.ownerDocument.defaultView:null,qa=(e,t)=>Math.abs(e-t);function Wg(e,t){const n=qa(e.x,t.x),s=qa(e.y,t.y);return Math.sqrt(n**2+s**2)}const Qa=new Set(["auto","scroll"]);class Eu{constructor(t,n,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Or(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Wg(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:x}=p,{timestamp:y}=Ve;this.history.push({...x,timestamp:y});const{onStart:v,onMove:R}=this.handlers;m||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=Mr(m,this.transformPagePoint),Re.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:x,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Or(p.type==="pointercancel"?this.lastMoveEventInfo:Mr(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),x&&x(p,v)},!Qo(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const c=Xn(t),l=Mr(c,this.transformPagePoint),{point:u}=l,{timestamp:f}=Ve;this.history=[{...u,timestamp:f}];const{onSessionStart:d}=n;d&&d(t,Or(l,this.history)),this.removeListeners=Yn(Fn(this.contextWindow,"pointermove",this.handlePointerMove),Fn(this.contextWindow,"pointerup",this.handlePointerUp),Fn(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const s=getComputedStyle(n);(Qa.has(s.overflowX)||Qa.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,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const s=t===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),Re.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ft(this.updatePoint)}}function Mr(e,t){return t?{point:t(e.point)}:e}function Za(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Or({point:e},t){return{point:e,delta:Za(e,Cu(t)),offset:Za(e,Hg(t)),velocity:$g(t,.1)}}function Hg(e){return e[0]}function Cu(e){return e[e.length-1]}function $g(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const r=Cu(e);for(;n>=0&&(s=e[n],!(r.timestamp-s.timestamp>Tt(t)));)n--;if(!s)return{x:0,y:0};const o=nt(r.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const i={x:(r.x-s.x)/o,y:(r.y-s.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Kg(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?Ee(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?Ee(n,e,s.max):Math.min(e,n)),e}function Ja(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _g(e,{top:t,left:n,bottom:s,right:r}){return{x:Ja(e.x,n,r),y:Ja(e.y,t,s)}}function ec(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function Yg(e,t){return{x:ec(e.x,t.x),y:ec(e.y,t.y)}}function Gg(e,t){let n=.5;const s=Ke(e),r=Ke(t);return r>s?n=Un(t.min,t.max-s,e.min):s>r&&(n=Un(e.min,e.max-r,t.min)),vt(0,1,n)}function zg(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fo=.35;function Xg(e=fo){return e===!1?e=0:e===!0&&(e=fo),{x:tc(e,"left","right"),y:tc(e,"top","bottom")}}function tc(e,t,n){return{min:nc(e,t),max:nc(e,n)}}function nc(e,t){return typeof e=="number"?e:e[t]||0}const qg=new WeakMap;class Qg{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=De(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{n?(this.stopAnimation(),this.snapToCursor(Xn(f).point)):this.pauseAnimation()},i=(f,d)=>{this.stopAnimation();const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Bp(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tt(y=>{let v=this.getAxisMotionValue(y).get()||0;if(pt.test(v)){const{projection:R}=this.visualElement;if(R&&R.layout){const w=R.layout.layoutBox[y];w&&(v=Ke(w)*(parseFloat(v)/100))}}this.originPoint[y]=v}),g&&Re.postRender(()=>g(f,d)),so(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=d;if(m&&this.currentDirection===null){this.currentDirection=Zg(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),x&&x(f,d)},c=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>tt(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Eu(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:Tu(this.visualElement),element:this.visualElement.current})}stop(t,n){const s=t||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!s)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Re.postRender(()=>a(s,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,s){const{drag:r}=this.getProps();if(!s||!rs(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(i=Kg(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&An(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=_g(s.layoutBox,t):this.constraints=!1,this.elastic=Xg(n),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&tt(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=zg(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!An(t))return!1;const s=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=tm(s,r.root,this.visualElement.getTransformPagePoint());let i=Yg(r.layout.layoutBox,o);if(n){const a=n(Zp(i));this.hasMutatedConstraints=!!a,a&&(i=Gl(a))}return i}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=tt(u=>{if(!rs(u,n,this.currentDirection))return;let f=c&&c[u]||{};i&&(f={min:0,max:0});const d=r?200:1e6,p=r?40:1e7,m={type:"inertia",velocity:s?t[u]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return so(this.visualElement,t),s.start(Yo(t,s,0,n,this.visualElement,!1))}stopAnimation(){tt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){tt(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),r=s[n];return r||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){tt(n=>{const{drag:s}=this.getProps();if(!rs(n,s,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:i,max:a}=r.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Ee(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!An(n)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};tt(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();r[i]=Gg({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),tt(i=>{if(!rs(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(Ee(c,l,r[i]))})}addListeners(){if(!this.visualElement.current)return;qg.set(this.visualElement,this);const t=this.visualElement.current,n=Fn(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps(),f=c.target,d=f!==t&&Wl(f);l&&u&&!d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();An(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Re.read(s);const i=Kn(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(tt(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())}));return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=fo,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function rs(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Zg(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Jg extends jt{constructor(t){super(t),this.removeGroupControls=ot,this.removeListeners=ot,this.controls=new Qg(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ot}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const sc=e=>(t,n)=>{e&&Re.postRender(()=>e(t,n))};class ey extends jt{constructor(){super(...arguments),this.removePointerDownListener=ot}onPointerDown(t){this.session=new Eu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Tu(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:sc(t),onStart:sc(n),onMove:s,onEnd:(o,i)=>{delete this.session,r&&Re.postRender(()=>r(o,i))}}}mount(){this.removePointerDownListener=Fn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ar=!1;class ty extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),s&&s.register&&r&&s.register(o),Ar&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:r,isPresent:o}=this.props,{projection:i}=s;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),Ar=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||Re.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),qo.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=t;Ar=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Pu(e){const[t,n]=mu(),s=h.useContext(Po);return $.jsx(ty,{...e,layoutGroup:s,switchLayoutGroup:h.useContext(wu),isPresent:t,safeToRemove:n})}const ny={pan:{Feature:ey},drag:{Feature:Jg,ProjectionNode:pu,MeasureLayout:Pu}};function rc(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=s[r];o&&Re.postRender(()=>o(t,Xn(t)))}class sy extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=jp(t,(n,s)=>(rc(this.node,s,"Start"),r=>rc(this.node,r,"End"))))}unmount(){}}class ry extends jt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Yn(Kn(this.node.current,"focus",()=>this.onFocus()),Kn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function oc(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=s[r];o&&Re.postRender(()=>o(t,Xn(t)))}class oy extends jt{mount(){const{current:t}=this.node;t&&(this.unmount=Hp(t,(n,s)=>(oc(this.node,s,"Start"),(r,{success:o})=>oc(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ho=new WeakMap,Ir=new WeakMap,iy=e=>{const t=ho.get(e.target);t&&t(e)},ay=e=>{e.forEach(iy)};function cy({root:e,...t}){const n=e||document;Ir.has(n)||Ir.set(n,{});const s=Ir.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(ay,{root:e,...t})),s[r]}function ly(e,t,n){const s=cy(t);return ho.set(e,n),s.observe(e),()=>{ho.delete(e),s.unobserve(e)}}const uy={some:0,all:1};class fy extends jt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:uy[r]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=l?u:f;d&&d(c)};return ly(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(dy(t,n))&&this.startObserver()}unmount(){}}function dy({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const hy={inView:{Feature:fy},tap:{Feature:oy},focus:{Feature:ry},hover:{Feature:sy}},py={layout:{ProjectionNode:pu,MeasureLayout:Pu}},my={...jg,...hy,...ny,...py},aw=Lg(my,Vg),gy=()=>{},ee=typeof document<"u"?h.useLayoutEffect:gy,Mu=h.createContext(void 0);function Zs(e){const t=h.useContext(Mu);if(t===void 0&&!e)throw new Error(Je(72));return t}const yy=[];function Ou(e){h.useEffect(e,yy)}const Mn=0;class Bt{static create(){return new Bt}currentId=Mn;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Mn,n()},t)}isStarted(){return this.currentId!==Mn}clear=()=>{this.currentId!==Mn&&(clearTimeout(this.currentId),this.currentId=Mn)};disposeEffect=()=>this.clear}function Ge(){const e=it(Bt.create).current;return Ou(e.disposeEffect),e}function Js(){return typeof window<"u"}function Ut(e){return oi(e)?(e.nodeName||"").toLowerCase():"#document"}function Ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rt(e){var t;return(t=(oi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oi(e){return Js()?e instanceof Node||e instanceof Ae(e).Node:!1}function ve(e){return Js()?e instanceof Element||e instanceof Ae(e).Element:!1}function Se(e){return Js()?e instanceof HTMLElement||e instanceof Ae(e).HTMLElement:!1}function po(e){return!Js()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ae(e).ShadowRoot}const vy=new Set(["inline","contents"]);function Jt(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=Ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!vy.has(r)}const by=new Set(["table","td","th"]);function xy(e){return by.has(Ut(e))}const Ry=[":popover-open",":modal"];function er(e){return Ry.some(t=>{try{return e.matches(t)}catch{return!1}})}const wy=["transform","translate","scale","rotate","perspective"],Sy=["transform","translate","scale","rotate","perspective","filter"],Ty=["paint","layout","strict","content"];function ii(e){const t=tr(),n=ve(e)?Ze(e):e;return wy.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Sy.some(s=>(n.willChange||"").includes(s))||Ty.some(s=>(n.contain||"").includes(s))}function Ey(e){let t=bt(e);for(;Se(t)&&!mt(t);){if(ii(t))return t;if(er(t))return null;t=bt(t)}return null}function tr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Cy=new Set(["html","body","#document"]);function mt(e){return Cy.has(Ut(e))}function Ze(e){return Ae(e).getComputedStyle(e)}function nr(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if(Ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||po(e)&&e.host||Rt(e);return po(t)?t.host:t}function Au(e){const t=bt(e);return mt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Se(t)&&Jt(t)?t:Au(t)}function Dt(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Au(e),o=r===((s=e.ownerDocument)==null?void 0:s.body),i=Ae(r);if(o){const a=mo(i);return t.concat(i,i.visualViewport||[],Jt(r)?r:[],a&&n?Dt(a):[])}return t.concat(r,Dt(r,[],n))}function mo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){const t=it(Py,e).current;return t.next=e,ee(t.effect),t}function Py(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Dr=Uc[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],My=Dr&&Dr!==h.useLayoutEffect?Dr:e=>e();function X(e){const t=it(Oy).current;return t.next=e,My(t.effect),t.trampoline}function Oy(){const e={next:void 0,callback:Ay,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ay(){}const Sn=typeof navigator<"u",kr=ky(),Iu=Vy(),Du=Ly(),Iy=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ku=kr.platform==="MacIntel"&&kr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(kr.platform),Lu=Sn&&/apple/i.test(navigator.vendor),go=Sn&&/android/i.test(Iu)||/android/i.test(Du),Dy=Sn&&Iu.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Vu=Du.includes("jsdom/");function ky(){if(!Sn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Ly(){if(!Sn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Vy(){if(!Sn)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const yo="data-base-ui-focusable",Fu="active",Nu="selected",Bu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",kt="ArrowLeft",Lt="ArrowRight",ai="ArrowUp",qn="ArrowDown";function ht(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function le(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&po(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ue(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Fy(e){return e.matches("html,body")}function Me(e){return e?.ownerDocument||document}function ci(e){return Se(e)&&e.matches(Bu)}function vo(e){return e?e.getAttribute("role")==="combobox"&&ci(e):!1}function Ny(e){if(!e||Vu)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ns(e){return e?e.hasAttribute(yo)?e:e.querySelector(`[${yo}]`)||e:null}function qt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...qt(e,r.id,n)])}function ic(e,t){let n=[],s=e.find(r=>r.id===t)?.parentId;for(;s;){const r=e.find(o=>o.id===s);s=r?.parentId,r&&(n=n.concat(r))}return n}function Be(e){e.preventDefault(),e.stopPropagation()}function By(e){return"nativeEvent"in e}function ju(e){return e.mozInputSource===0&&e.isTrusted?!0:go&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Uu(e){return Vu?!1:!go&&e.width===0&&e.height===0||go&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Qt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Wu(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const jy=["top","right","bottom","left"],mn=Math.min,Qe=Math.max,Bs=Math.round,cn=Math.floor,gt=e=>({x:e,y:e}),Uy={left:"right",right:"left",bottom:"top",top:"bottom"},Wy={start:"end",end:"start"};function bo(e,t,n){return Qe(e,mn(t,n))}function Ct(e,t){return typeof e=="function"?e(t):e}function Ye(e){return e.split("-")[0]}function Wt(e){return e.split("-")[1]}function li(e){return e==="x"?"y":"x"}function ui(e){return e==="y"?"height":"width"}const Hy=new Set(["top","bottom"]);function st(e){return Hy.has(Ye(e))?"y":"x"}function fi(e){return li(st(e))}function $y(e,t,n){n===void 0&&(n=!1);const s=Wt(e),r=fi(e),o=ui(r);let i=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=js(i)),[i,js(i)]}function Ky(e){const t=js(e);return[xo(e),t,xo(t)]}function xo(e){return e.replace(/start|end/g,t=>Wy[t])}const ac=["left","right"],cc=["right","left"],_y=["top","bottom"],Yy=["bottom","top"];function Gy(e,t,n){switch(e){case"top":case"bottom":return n?t?cc:ac:t?ac:cc;case"left":case"right":return t?_y:Yy;default:return[]}}function zy(e,t,n,s){const r=Wt(e);let o=Gy(Ye(e),n==="start",s);return r&&(o=o.map(i=>i+"-"+r),t&&(o=o.concat(o.map(xo)))),o}function js(e){return e.replace(/left|right|bottom|top/g,t=>Uy[t])}function Xy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hu(e){return typeof e!="number"?Xy(e):{top:e,right:e,bottom:e,left:e}}function Us(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function os(e,t,n){return Math.floor(e/t)!==n}function Nn(e,t){return t<0||t>=e.current.length}function Lr(e,t){return Ne(e,{disabledIndices:t})}function lc(e,t){return Ne(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ne(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:r=1}={}){let o=t;do o+=n?-r:r;while(o>=0&&o<=e.current.length-1&&Bn(e,o,s));return o}function qy(e,{event:t,orientation:n,loopFocus:s,rtl:r,cols:o,disabledIndices:i,minIndex:a,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let f=l;const d=[],p={};let m=!1;{let y=null,v=-1;e.current.forEach((R,w)=>{if(R==null)return;const b=R.closest('[role="row"]');b&&(m=!0),(b!==y||v===-1)&&(y=b,v+=1,d[v]=[]),d[v].push(w),p[w]=v})}const g=m&&d.length>0&&d.some(y=>y.length!==o);function x(y){if(!g||l===-1)return;const v=p[l];if(v==null)return;const R=d[v].indexOf(l);let w=y==="up"?v-1:v+1;s&&(w<0?w=d.length-1:w>=d.length&&(w=0));const b=new Set;for(;w>=0&&w<d.length&&!b.has(w);){b.add(w);const T=d[w];if(T.length===0){w=y==="up"?w-1:w+1;continue}const E=Math.min(R,T.length-1);for(let S=E;S>=0;S-=1){const O=T[S];if(!Bn(e,O,i))return O}w=y==="up"?w-1:w+1,s&&(w<0?w=d.length-1:w>=d.length&&(w=0))}}if(t.key===ai){const y=x("up");if(y!==void 0)u&&Be(t),f=y;else{if(u&&Be(t),l===-1)f=c;else if(f=Ne(e,{startingIndex:f,amount:o,decrement:!0,disabledIndices:i}),s&&(l-o<a||f<0)){const v=l%o,R=c%o,w=c-(R-v);R===v?f=c:f=R>v?w:w-o}Nn(e,f)&&(f=l)}}if(t.key===qn){const y=x("down");y!==void 0?(u&&Be(t),f=y):(u&&Be(t),l===-1?f=a:(f=Ne(e,{startingIndex:l,amount:o,disabledIndices:i}),s&&l+o>c&&(f=Ne(e,{startingIndex:l%o-o,amount:o,disabledIndices:i}))),Nn(e,f)&&(f=l))}if(n==="both"){const y=cn(l/o);t.key===(r?kt:Lt)&&(u&&Be(t),l%o!==o-1?(f=Ne(e,{startingIndex:l,disabledIndices:i}),s&&os(f,o,y)&&(f=Ne(e,{startingIndex:l-l%o-1,disabledIndices:i}))):s&&(f=Ne(e,{startingIndex:l-l%o-1,disabledIndices:i})),os(f,o,y)&&(f=l)),t.key===(r?Lt:kt)&&(u&&Be(t),l%o!==0?(f=Ne(e,{startingIndex:l,decrement:!0,disabledIndices:i}),s&&os(f,o,y)&&(f=Ne(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:i}))):s&&(f=Ne(e,{startingIndex:l+(o-l%o),decrement:!0,disabledIndices:i})),os(f,o,y)&&(f=l));const v=cn(c/o)===y;Nn(e,f)&&(s&&v?f=t.key===(r?Lt:kt)?c:Ne(e,{startingIndex:l-l%o-1,disabledIndices:i}):f=l)}return f}function Qy(e,t,n){const s=[];let r=0;return e.forEach(({width:o,height:i},a)=>{let c=!1;for(n&&(r=0);!c;){const l=[];for(let u=0;u<o;u+=1)for(let f=0;f<i;f+=1)l.push(r+u+f*t);r%t+o<=t&&l.every(u=>s[u]==null)?(l.forEach(u=>{s[u]=a}),c=!0):r+=1}}),[...s]}function Zy(e,t,n,s,r){if(e===-1)return-1;const o=n.indexOf(e),i=t[e];switch(r){case"tl":return o;case"tr":return i?o+i.width-1:o;case"bl":return i?o+(i.height-1)*s:o;case"br":return n.lastIndexOf(e);default:return-1}}function Jy(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function Bn(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var ev=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Ws=ev.join(","),$u=typeof Element>"u",gn=$u?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hs=!$u&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},$s=function(t,n){var s;n===void 0&&(n=!0);var r=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),o=r===""||r==="true",i=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):$s(t.parentNode));return i},tv=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},Ku=function(t,n,s){if($s(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Ws));return n&&gn.call(t,Ws)&&r.unshift(t),r=r.filter(s),r},Ks=function(t,n,s){for(var r=[],o=Array.from(t);o.length;){var i=o.shift();if(!$s(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Ks(c,!0,s);s.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=gn.call(i,Ws);u&&s.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(i),d=!$s(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(i));if(f&&d){var p=Ks(f===!0?i.children:f.children,!0,s);s.flatten?r.push.apply(r,p):r.push({scopeParent:i,candidates:p})}else o.unshift.apply(o,i.children)}}return r},_u=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Yu=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||tv(t))&&!_u(t)?0:t.tabIndex},nv=function(t,n){var s=Yu(t);return s<0&&n&&!_u(t)?0:s},sv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Gu=function(t){return t.tagName==="INPUT"},rv=function(t){return Gu(t)&&t.type==="hidden"},ov=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},iv=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},av=function(t){if(!t.name)return!0;var n=t.form||Hs(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=s(window.CSS.escape(t.name));else try{r=s(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=iv(r,t.form);return!o||o===t},cv=function(t){return Gu(t)&&t.type==="radio"},lv=function(t){return cv(t)&&!av(t)},uv=function(t){var n,s=t&&Hs(t),r=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==t){var i,a,c;for(o=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!o&&r;){var l,u,f;s=Hs(r),r=(l=s)===null||l===void 0?void 0:l.host,o=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return o},uc=function(t){var n=t.getBoundingClientRect(),s=n.width,r=n.height;return s===0&&r===0},fv=function(t,n){var s=n.displayCheck,r=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var i=gn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(gn.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=Hs(t);if(l&&!l.shadowRoot&&r(l)===!0)return uc(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(uv(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return uc(t);return!1},dv=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var r=n.children.item(s);if(r.tagName==="LEGEND")return gn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Ro=function(t,n){return!(n.disabled||rv(n)||fv(n,t)||ov(n)||dv(n))},wo=function(t,n){return!(lv(n)||Yu(n)<0||!Ro(t,n))},hv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},zu=function(t){var n=[],s=[];return t.forEach(function(r,o){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=nv(a,i),l=i?zu(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):s.push({documentOrder:o,tabIndex:c,item:r,isScope:i,content:l})}),s.sort(sv).reduce(function(r,o){return o.isScope?r.push.apply(r,o.content):r.push(o.content),r},[]).concat(n)},Qn=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Ks([t],n.includeContainer,{filter:wo.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:hv}):s=Ku(t,n.includeContainer,wo.bind(null,n)),zu(s)},pv=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Ks([t],n.includeContainer,{filter:Ro.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=Ku(t,n.includeContainer,Ro.bind(null,n)),s},Xu=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return gn.call(t,Ws)===!1?!1:wo(n,t)};const Tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qu(e,t){const n=Qn(e,Tn()),s=n.length;if(s===0)return;const r=ht(Me(e)),o=n.indexOf(r),i=o===-1?t===1?0:s-1:o+t;return n[i]}function di(e){return qu(Me(e).body,1)||e}function Qu(e){return qu(Me(e).body,-1)||e}function Zu(e,t){if(!e)return null;const n=Qn(Me(e).body,Tn()),s=n.length;if(s===0)return null;const r=n.indexOf(e);if(r===-1)return null;const o=(r+t+s)%s;return n[o]}function mv(e){return Zu(e,1)}function gv(e){return Zu(e,-1)}function un(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!le(n,s)}function yv(e){Qn(e,Tn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function fc(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}const vv={...Uc};let dc=0;function bv(e,t="mui"){const[n,s]=h.useState(e),r=e||n;return h.useEffect(()=>{n==null&&(dc+=1,s(`${t}-${dc}`))},[n,t]),r}const hc=vv.useId;function en(e,t){if(hc!==void 0){const n=hc();return e??(t?`${t}-${n}`:n)}return bv(e,t)}function Ju(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class hi{nodesRef={current:[]};events=Ju();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(s=>s===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ef=h.createContext(null),tf=h.createContext(null),Mt=()=>h.useContext(ef)?.id||null,Ht=e=>{const t=h.useContext(tf);return e??t};function nf(e){const t=en(),n=Ht(e),s=Mt();return ee(()=>{if(!t)return;const r={id:t,parentId:s};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,s]),t}function xv(e){const{children:t,id:n}=e,s=Mt();return $.jsx(ef.Provider,{value:h.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function Rv(e){const{children:t,externalTree:n}=e,s=it(()=>n??new hi).current;return $.jsx(tf.Provider,{value:s,children:t})}const pi="none",Vt="trigger-press",We="trigger-hover",fn="trigger-focus",mi="outside-press",sf="item-press",wv="close-press",yn="focus-out",sr="escape-key",bs="list-navigation",Sv="cancel-open",In="sibling-open",Tv="disabled",gi="imperative-action";function ue(e,t,n,s){let r=!1,o=!1;const i=s??rt;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:n,...i}}function vn(e){return`data-base-ui-${e}`}function xs(e,t,n){if(n&&!Qt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const s=e();return typeof s=="number"?s:s?.[t]}return e?.[t]}const rf=h.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Bt,currentIdRef:{current:null},currentContextRef:{current:null}});function Ev(e){const{children:t,delay:n,timeoutMs:s=0}=e,r=h.useRef(n),o=h.useRef(n),i=h.useRef(null),a=h.useRef(null),c=Ge();return $.jsx(rf.Provider,{value:h.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:o,currentIdRef:i,timeoutMs:s,currentContextRef:a,timeout:c}),[s,c]),children:t})}function Cv(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,s=n.useState("floatingId"),{enabled:r=!0,open:o}=t,i=h.useContext(rf),{currentIdRef:a,delayRef:c,timeoutMs:l,initialDelayRef:u,currentContextRef:f,hasProvider:d,timeout:p}=i,[m,g]=h.useState(!1);return ee(()=>{function x(){g(!1),f.current?.setIsInstantPhase(!1),a.current=null,f.current=null,c.current=u.current}if(r&&a.current&&!o&&a.current===s){if(g(!1),l){const y=s;return p.start(l,()=>{n.select("open")||a.current&&a.current!==y||x()}),()=>{p.clear()}}x()}},[r,o,s,a,c,l,u,f,p,n]),ee(()=>{if(!r||!o)return;const x=f.current,y=a.current;p.clear(),f.current={onOpenChange:n.setOpen,setIsInstantPhase:g},a.current=s,c.current={open:0,close:xs(u.current,"close")},y!==null&&y!==s?(g(!0),x?.setIsInstantPhase(!0),x?.onOpenChange(!1,ue(pi))):(g(!1),x?.setIsInstantPhase(!1))},[r,o,s,n,a,c,l,u,f,p]),ee(()=>()=>{f.current=null},[f]),h.useMemo(()=>({hasProvider:d,delayRef:c,isInstantPhase:m}),[d,c,m])}const of={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},af={...of,position:"fixed",top:0,left:0},cw={...of,position:"absolute"},is=null;class Pv{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const as=new Pv;class dt{static create(){return new dt}static request(t){return as.request(t)}static cancel(t){return as.cancel(t)}currentId=is;request(t){this.cancel(),this.currentId=as.request(()=>{this.currentId=is,t()})}cancel=()=>{this.currentId!==is&&(as.cancel(this.currentId),this.currentId=is)};disposeEffect=()=>this.cancel}function rr(){const e=it(dt.create).current;return Ou(e.disposeEffect),e}function xt(e){return e?.ownerDocument||document}const bn=h.forwardRef(function(t,n){const[s,r]=h.useState();ee(()=>{Lu&&r("button")},[]);const o={tabIndex:0,role:s};return $.jsx("span",{...t,ref:n,style:af,"aria-hidden":s?void 0:!0,...o,"data-base-ui-focus-guard":""})});let pc=0;function Rs(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:r=!1}=t;s&&cancelAnimationFrame(pc);const o=()=>e?.focus({preventScroll:n});r?o():pc=requestAnimationFrame(o)}const dn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function mc(e){return e==="inert"?dn.inert:e==="aria-hidden"?dn["aria-hidden"]:dn.none}let cs=new WeakSet,ls={},Vr=0;const cf=e=>e&&(e.host||cf(e.parentNode)),Mv=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=cf(n);return e.contains(s)?s:null}).filter(n=>n!=null);function Ov(e,t,n,s){const r="data-base-ui-inert",o=s?"inert":n?"aria-hidden":null,i=Mv(t,e),a=new Set,c=new Set(i),l=[];ls[r]||(ls[r]=new WeakMap);const u=ls[r];i.forEach(f),d(t),a.clear();function f(p){!p||a.has(p)||(a.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||c.has(p)||[].forEach.call(p.children,m=>{if(Ut(m)!=="script")if(a.has(m))d(m);else{const g=o?m.getAttribute(o):null,x=g!==null&&g!=="false",y=mc(o),v=(y.get(m)||0)+1,R=(u.get(m)||0)+1;y.set(m,v),u.set(m,R),l.push(m),v===1&&x&&cs.add(m),R===1&&m.setAttribute(r,""),!x&&o&&m.setAttribute(o,o==="inert"?"":"true")}})}return Vr+=1,()=>{l.forEach(p=>{const m=mc(o),x=(m.get(p)||0)-1,y=(u.get(p)||0)-1;m.set(p,x),u.set(p,y),x||(!cs.has(p)&&o&&p.removeAttribute(o),cs.delete(p)),y||p.removeAttribute(r)}),Vr-=1,Vr||(dn.inert=new WeakMap,dn["aria-hidden"]=new WeakMap,dn.none=new WeakMap,cs=new WeakSet,ls={})}}function Av(e,t=!1,n=!1){const s=Me(e[0]).body;return Ov(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const lf=h.createContext(null),uf=()=>h.useContext(lf),Iv=vn("portal");function ff(e={}){const{ref:t,container:n,componentProps:s=rt,elementProps:r,elementState:o}=e,i=en(),c=uf()?.portalNode,[l,u]=h.useState(null),[f,d]=h.useState(null),p=X(y=>{y!==null&&d(y)}),m=h.useRef(null);ee(()=>{if(n===null){m.current&&(m.current=null,d(null),u(null));return}if(i==null)return;const y=(n&&(oi(n)?n:n.current))??c??document.body;if(y==null){m.current&&(m.current=null,d(null),u(null));return}m.current!==y&&(m.current=y,d(null),u(y))},[n,c,i]);const g=ze("div",s,{ref:[t,p],state:o,props:[{id:i,[Iv]:""},r]});return{portalNode:f,portalSubtree:l&&g?yt.createPortal(g,l):null}}const df=h.forwardRef(function(t,n){const{children:s,container:r,className:o,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=ff({container:r,ref:n,componentProps:t,elementProps:c}),f=h.useRef(null),d=h.useRef(null),p=h.useRef(null),m=h.useRef(null),[g,x]=h.useState(null),y=g?.modal,v=g?.open,R=typeof a=="boolean"?a:!!g&&!g.modal&&g.open&&!!l;h.useEffect(()=>{if(!l||y)return;function b(T){l&&T.relatedTarget&&un(T)&&(T.type==="focusin"?fc:yv)(l)}return l.addEventListener("focusin",b,!0),l.addEventListener("focusout",b,!0),()=>{l.removeEventListener("focusin",b,!0),l.removeEventListener("focusout",b,!0)}},[l,y]),h.useEffect(()=>{!l||v||fc(l)},[v,l]);const w=h.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:x}),[l]);return $.jsxs(h.Fragment,{children:[u,$.jsxs(lf.Provider,{value:w,children:[R&&l&&$.jsx(bn,{"data-type":"outside",ref:f,onFocus:b=>{if(un(b,l))p.current?.focus();else{const T=g?g.domReference:null;Qu(T)?.focus()}}}),R&&l&&$.jsx("span",{"aria-owns":l.id,style:Ld}),l&&yt.createPortal(s,l),R&&l&&$.jsx(bn,{"data-type":"outside",ref:d,onFocus:b=>{if(un(b,l))m.current?.focus();else{const T=g?g.domReference:null;di(T)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,ue(yn,b.nativeEvent))}}})]})]})});function St(e){return e==null?e:"current"in e?e.current:e}function Dv(e,t){const n=Ae(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const gc=20;let It=[];function yi(){It=It.filter(e=>e.isConnected)}function kv(e){yi(),e&&Ut(e)!=="body"&&(It.push(e),It.length>gc&&(It=It.slice(-gc)))}function Fr(){return yi(),It[It.length-1]}function Lv(e){if(!e)return null;const t=Tn();return Xu(e,t)?e:Qn(e,t)[0]||e}function Vv(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ze(e).display!=="none"}function yc(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Tn(),r=pv(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return Xu(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hf(e){const{context:t,children:n,disabled:s=!1,order:r=["content"],initialFocus:o=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:d,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:g}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),v=x.useState("domReferenceElement"),R=x.useState("floatingElement"),{events:w,dataRef:b}=x.context,T=X(()=>b.current.floatingContext?.nodeId),E=X(f),S=o===!1,O=vo(v)&&S,A=je(r),L=je(o),I=je(i),C=je(u),N=Ht(g),D=uf(),j=h.useRef(null),k=h.useRef(null),P=h.useRef(!1),B=h.useRef(!1),V=h.useRef(!1),Y=h.useRef(-1),ie=h.useRef(""),W=h.useRef(""),ae=h.useRef(null),fe=h.useRef(null),re=Cs(ae,m,D?.beforeInsideRef),J=Cs(fe,D?.afterInsideRef),ge=Ge(),pe=Ge(),oe=rr(),he=D!=null,M=Ns(R),te=X((F=M)=>F?Qn(F,Tn()):[]),K=X(F=>{const U=te(F);return A.current.map(()=>U).filter(Boolean).flat()});h.useEffect(()=>{if(s||!c)return;function F(z){z.key==="Tab"&&le(M,ht(Me(M)))&&te().length===0&&!O&&Be(z)}const U=Me(M);return U.addEventListener("keydown",F),()=>{U.removeEventListener("keydown",F)}},[s,v,M,c,A,O,te,K]),h.useEffect(()=>{if(s||!R)return;function F(U){const z=Ue(U),de=te().indexOf(z);de!==-1&&(Y.current=de)}return R.addEventListener("focusin",F),()=>{R.removeEventListener("focusin",F)}},[s,R,te]),h.useEffect(()=>{if(s||!y)return;const F=Me(M);function U(){V.current=!1}function z(de){const Q=Ue(de),Z=le(R,Q)||le(v,Q)||le(D?.portalNode,Q);V.current=!Z,W.current=de.pointerType||"keyboard"}function ne(){W.current="keyboard"}return F.addEventListener("pointerdown",z,!0),F.addEventListener("pointerup",U,!0),F.addEventListener("pointercancel",U,!0),F.addEventListener("keydown",ne,!0),()=>{F.removeEventListener("pointerdown",z,!0),F.removeEventListener("pointerup",U,!0),F.removeEventListener("pointercancel",U,!0),F.removeEventListener("keydown",ne,!0)}},[s,R,v,M,y,D]),h.useEffect(()=>{if(s||!l)return;function F(){B.current=!0,pe.start(0,()=>{B.current=!1})}function U(Q){const Z=Q.relatedTarget,H=Q.currentTarget,se=Ue(Q);queueMicrotask(()=>{const G=T(),me=x.context.triggerElements,xe=Z?.hasAttribute(vn("focus-guard"))&&[ae.current,fe.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,St(p),St(d)].includes(Z),Te=!(le(v,Z)||le(R,Z)||le(Z,R)||le(D?.portalNode,Z)||Z!=null&&me.hasElement(Z)||me.hasMatchingElement(we=>le(we,Z))||xe||N&&(qt(N.nodesRef.current,G).find(we=>le(we.context?.elements.floating,Z)||le(we.context?.elements.domReference,Z))||ic(N.nodesRef.current,G).find(we=>[we.context?.elements.floating,Ns(we.context?.elements.floating)].includes(Z)||we.context?.elements.domReference===Z)));if(H===v&&M&&yc(M,A),a&&H!==v&&!Vv(se)&&ht(Me(M))===Me(M).body){if(Se(M)&&(M.focus(),a==="popup")){oe.request(()=>{M.focus()});return}const we=Y.current,Fe=te(),Le=Fe[we]||Fe[Fe.length-1]||M;Se(Le)&&Le.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(O||!c)&&Z&&Te&&!B.current&&(O||Z!==Fr())&&(P.current=!0,x.setOpen(!1,ue(yn,Q)))})}function z(){V.current||(b.current.insideReactTree=!0,ge.start(0,()=>{b.current.insideReactTree=!1}))}const ne=Se(v)?v:null,de=[];if(!(!R&&!ne))return ne&&(ne.addEventListener("focusout",U),ne.addEventListener("pointerdown",F),de.push(()=>{ne.removeEventListener("focusout",U),ne.removeEventListener("pointerdown",F)})),R&&(R.addEventListener("focusout",U),D&&(R.addEventListener("focusout",z,!0),de.push(()=>{R.removeEventListener("focusout",z,!0)})),de.push(()=>{R.removeEventListener("focusout",U)})),()=>{de.forEach(Q=>{Q()})}},[s,v,R,M,c,N,D,x,l,a,te,O,T,A,b,ge,pe,oe,d,p]),h.useEffect(()=>{if(s||!R||!y)return;const F=Array.from(D?.portalNode?.querySelectorAll(`[${vn("portal")}]`)||[]),z=(N?ic(N.nodesRef.current,T()):[]).find(Q=>vo(Q.context?.elements.domReference||null))?.context?.elements.domReference,ne=[R,z,...F,...E(),j.current,k.current,ae.current,fe.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,St(p),St(d),O?v:null].filter(Q=>Q!=null),de=Av(ne,c||O);return()=>{de()}},[y,s,v,R,c,A,D,O,N,T,E,d,p]),ee(()=>{if(!y||s||!Se(M))return;const F=Me(M),U=ht(F);queueMicrotask(()=>{const z=K(M),ne=L.current,de=typeof ne=="function"?ne(C.current||""):ne;if(de===void 0||de===!1)return;let Q;de===!0||de===null?Q=z[0]||M:Q=St(de),Q=Q||z[0]||M,!le(M,U)&&Rs(Q,{preventScroll:Q===M})})},[s,y,M,S,K,L,C]),ee(()=>{if(s||!M)return;const F=Me(M),U=ht(F);kv(U);function z(Q){if(Q.open||(ie.current=Dv(Q.nativeEvent,W.current)),Q.reason===We&&Q.nativeEvent.type==="mouseleave"&&(P.current=!0),Q.reason===mi)if(Q.nested)P.current=!1;else if(ju(Q.nativeEvent)||Uu(Q.nativeEvent))P.current=!1;else{let Z=!1;document.createElement("div").focus({get preventScroll(){return Z=!0,!1}}),Z?P.current=!1:P.current=!0}}w.on("openchange",z);const ne=F.createElement("span");ne.setAttribute("tabindex","-1"),ne.setAttribute("aria-hidden","true"),Object.assign(ne.style,af),he&&v&&v.insertAdjacentElement("afterend",ne);function de(){const Q=I.current;let Z=typeof Q=="function"?Q(ie.current):Q;if(Z===void 0||Z===!1)return null;if(Z===null&&(Z=!0),typeof Z=="boolean"){const se=v||Fr();return se&&se.isConnected?se:ne}const H=v||Fr()||ne;return St(Z)||H}return()=>{w.off("openchange",z);const Q=ht(F),Z=le(R,Q)||N&&qt(N.nodesRef.current,T(),!1).some(se=>le(se.context?.elements.floating,Q)),H=de();queueMicrotask(()=>{const se=Lv(H),G=typeof I.current!="boolean";I.current&&!P.current&&Se(se)&&(!(!G&&se!==Q&&Q!==F.body)||Z)&&se.focus({preventScroll:!0}),ne.remove()})}},[s,R,M,I,b,w,N,he,v,T]),h.useEffect(()=>{queueMicrotask(()=>{P.current=!1})},[s]),h.useEffect(()=>{if(s||!y)return;function F(z){Ue(z)?.closest(`[${Dd}]`)&&(B.current=!0)}const U=Me(M);return U.addEventListener("pointerdown",F,!0),()=>{U.removeEventListener("pointerdown",F,!0)}},[s,y,M]),ee(()=>{if(!s&&D)return D.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:x.setOpen,domReference:v}),()=>{D.setFocusManagerState(null)}},[s,D,c,y,x,l,v]),ee(()=>{if(!(s||!M))return yc(M,A),()=>{queueMicrotask(yi)}},[s,M,A]);const ye=!s&&(c?!O:!0)&&(he||c);return $.jsxs(h.Fragment,{children:[ye&&$.jsx(bn,{"data-type":"inside",ref:re,onFocus:F=>{if(c){const U=K();Rs(U[U.length-1])}else D?.portalNode&&(P.current=!1,un(F,D.portalNode)?di(v)?.focus():St(p??D.beforeOutsideRef)?.focus())}}),n,ye&&$.jsx(bn,{"data-type":"inside",ref:J,onFocus:F=>{c?Rs(K()[0]):D?.portalNode&&(l&&(P.current=!0),un(F,D.portalNode)?Qu(v)?.focus():St(d??D.afterOutsideRef)?.focus())}})]})}function Fv(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.context.dataRef,{enabled:r=!0,event:o="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=h.useRef(void 0),f=rr(),d=Ge(),p=h.useMemo(()=>({onPointerDown(m){u.current=m.pointerType},onMouseDown(m){const g=u.current,x=m.nativeEvent,y=n.select("open");if(m.button!==0||o==="click"||Qt(g,!0)&&a)return;const v=s.current.openEvent,R=v?.type,w=n.select("domReferenceElement")!==m.currentTarget,b=y&&w||!(y&&i&&(!(v&&c)||R==="click"||R==="mousedown"));if(ci(x.target)){const E=ue(Vt,x,x.target);b&&g==="touch"&&l>0?d.start(l,()=>{n.setOpen(!0,E)}):n.setOpen(b,E);return}const T=m.currentTarget;f.request(()=>{const E=ue(Vt,x,T);b&&g==="touch"&&l>0?d.start(l,()=>{n.setOpen(!0,E)}):n.setOpen(b,E)})},onClick(m){if(o==="mousedown-only")return;const g=u.current;if(o==="mousedown"&&g){u.current=void 0;return}if(Qt(g,!0)&&a)return;const x=n.select("open"),y=s.current.openEvent,v=n.select("domReferenceElement")!==m.currentTarget,R=x&&v||!(x&&i&&(!(y&&c)||Wu(y))),w=ue(Vt,m.nativeEvent,m.currentTarget);R&&g==="touch"&&l>0?d.start(l,()=>{n.setOpen(!0,w)}):n.setOpen(R,w)},onKeyDown(){u.current=void 0}}),[s,o,a,n,c,i,f,d,l]);return h.useMemo(()=>r?{reference:p}:rt,[r,p])}function Nv(e,t){let n=null,s=null,r=!1;return{contextElement:e||void 0,getBoundingClientRect(){const o=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let l=o.width,u=o.height,f=o.x,d=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),s==null&&t.y&&a&&(s=o.y-t.y),f-=n||0,d-=s||0,l=0,u=0,!r||c?(l=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,f=i&&t.x!=null?t.x:f,d=a&&t.y!=null?t.y:d):r&&!c&&(u=t.axis==="x"?o.height:u,l=t.axis==="y"?o.width:l),r=!0,{width:l,height:u,x:f,y:d,top:d,right:f+l,bottom:d+u,left:f}}}}function vc(e){return e!=null&&e.clientX!=null}function Bv(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingElement"),o=n.useState("domReferenceElement"),i=n.context.dataRef,{enabled:a=!0,axis:c="both",x:l=null,y:u=null}=t,f=h.useRef(!1),d=h.useRef(null),[p,m]=h.useState(),[g,x]=h.useState([]),y=X((T,E,S)=>{f.current||i.current.openEvent&&!vc(i.current.openEvent)||n.set("positionReference",Nv(S??o,{x:T,y:E,axis:c,dataRef:i,pointerType:p}))}),v=X(T=>{l!=null||u!=null||(s?d.current||x([]):y(T.clientX,T.clientY,T.currentTarget))}),R=Qt(p)?r:s,w=h.useCallback(()=>{if(!R||!a||l!=null||u!=null)return;const T=Ae(r);function E(S){const O=Ue(S);le(r,O)?(T.removeEventListener("mousemove",E),d.current=null):y(S.clientX,S.clientY)}if(!i.current.openEvent||vc(i.current.openEvent)){T.addEventListener("mousemove",E);const S=()=>{T.removeEventListener("mousemove",E),d.current=null};return d.current=S,S}n.set("positionReference",o)},[R,a,l,u,r,i,o,n,y]);h.useEffect(()=>w(),[w,g]),h.useEffect(()=>{a&&!r&&(f.current=!1)},[a,r]),h.useEffect(()=>{!a&&s&&(f.current=!0)},[a,s]),ee(()=>{a&&(l!=null||u!=null)&&(f.current=!1,y(l,u))},[a,l,u,y]);const b=h.useMemo(()=>{function T(E){m(E.pointerType)}return{onPointerDown:T,onPointerEnter:T,onMouseMove:v,onMouseEnter:v}},[v]);return h.useMemo(()=>a?{reference:b,trigger:b}:{},[a,b])}function bc(e,t,n){let{reference:s,floating:r}=e;const o=st(t),i=fi(t),a=ui(i),c=Ye(t),l=o==="y",u=s.x+s.width/2-r.width/2,f=s.y+s.height/2-r.height/2,d=s[a]/2-r[a]/2;let p;switch(c){case"top":p={x:u,y:s.y-r.height};break;case"bottom":p={x:u,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-r.width,y:f};break;default:p={x:s.x,y:s.y}}switch(Wt(t)){case"start":p[i]-=d*(n&&l?-1:1);break;case"end":p[i]+=d*(n&&l?-1:1);break}return p}async function jv(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Ct(t,e),m=Hu(p),x=a[d?f==="floating"?"reference":"floating":f],y=Us(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=f==="floating"?{x:s,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},b=Us(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:R,strategy:c}):v);return{top:(y.top-b.top+m.top)/w.y,bottom:(b.bottom-y.bottom+m.bottom)/w.y,left:(y.left-b.left+m.left)/w.x,right:(b.right-y.right+m.right)/w.x}}const Uv=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=bc(l,s,c),d=s,p={},m=0;for(let x=0;x<a.length;x++){var g;const{name:y,fn:v}=a[x],{x:R,y:w,data:b,reset:T}=await v({x:u,y:f,initialPlacement:s,placement:d,strategy:r,middlewareData:p,rects:l,platform:{...i,detectOverflow:(g=i.detectOverflow)!=null?g:jv},elements:{reference:e,floating:t}});u=R??u,f=w??f,p={...p,[y]:{...p[y],...b}},T&&m<=50&&(m++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(l=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):T.rects),{x:u,y:f}=bc(l,d,c)),x=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:p}},Wv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=Ct(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=Ye(r),v=st(a),R=Ye(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),b=d||(R||!g?[js(a)]:Ky(a)),T=m!=="none";!d&&T&&b.push(...zy(a,g,m,w));const E=[a,...b],S=await c.detectOverflow(t,x),O=[];let A=((s=o.flip)==null?void 0:s.overflows)||[];if(u&&O.push(S[y]),f){const N=$y(r,i,w);O.push(S[N[0]],S[N[1]])}if(A=[...A,{placement:r,overflows:O}],!O.every(N=>N<=0)){var L,I;const N=(((L=o.flip)==null?void 0:L.index)||0)+1,D=E[N];if(D&&(!(f==="alignment"?v!==st(D):!1)||A.every(P=>st(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:N,overflows:A},reset:{placement:D}};let j=(I=A.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:I.placement;if(!j)switch(p){case"bestFit":{var C;const k=(C=A.filter(P=>{if(T){const B=st(P.placement);return B===v||B==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(B=>B>0).reduce((B,V)=>B+V,0)]).sort((P,B)=>P[1]-B[1])[0])==null?void 0:C[0];k&&(j=k);break}case"initialPlacement":j=a;break}if(r!==j)return{reset:{placement:j}}}return{}}}};function xc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rc(e){return jy.some(t=>e[t]>=0)}const Hv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:r="referenceHidden",...o}=Ct(e,t);switch(r){case"referenceHidden":{const i=await s.detectOverflow(t,{...o,elementContext:"reference"}),a=xc(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Rc(a)}}}case"escaped":{const i=await s.detectOverflow(t,{...o,altBoundary:!0}),a=xc(i,n.floating);return{data:{escapedOffsets:a,escaped:Rc(a)}}}default:return{}}}}},pf=new Set(["left","top"]);async function $v(e,t){const{placement:n,platform:s,elements:r}=e,o=await(s.isRTL==null?void 0:s.isRTL(r.floating)),i=Ye(n),a=Wt(n),c=st(n)==="y",l=pf.has(i)?-1:1,u=o&&c?-1:1,f=Ct(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}const Kv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:o,placement:i,middlewareData:a}=t,c=await $v(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:o+c.y,data:{...c,placement:i}}}}},_v=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:v,y:R}=y;return{x:v,y:R}}},...l}=Ct(e,t),u={x:n,y:s},f=await o.detectOverflow(t,l),d=st(Ye(r)),p=li(d);let m=u[p],g=u[d];if(i){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",R=m+f[y],w=m-f[v];m=bo(R,m,w)}if(a){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",R=g+f[y],w=g-f[v];g=bo(R,g,w)}const x=c.fn({...t,[p]:m,[d]:g});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[p]:i,[d]:a}}}}}},Yv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:r,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Ct(e,t),u={x:n,y:s},f=st(r),d=li(f);let p=u[d],m=u[f];const g=Ct(a,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const R=d==="y"?"height":"width",w=o.reference[d]-o.floating[R]+x.mainAxis,b=o.reference[d]+o.reference[R]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var y,v;const R=d==="y"?"width":"height",w=pf.has(Ye(r)),b=o.reference[f]-o.floating[R]+(w&&((y=i.offset)==null?void 0:y[f])||0)+(w?0:x.crossAxis),T=o.reference[f]+o.reference[R]+(w?0:((v=i.offset)==null?void 0:v[f])||0)-(w?x.crossAxis:0);m<b?m=b:m>T&&(m=T)}return{[d]:p,[f]:m}}}},Gv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:o,platform:i,elements:a}=t,{apply:c=()=>{},...l}=Ct(e,t),u=await i.detectOverflow(t,l),f=Ye(r),d=Wt(r),p=st(r)==="y",{width:m,height:g}=o.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,x=d==="end"?"top":"bottom");const v=g-u.top-u.bottom,R=m-u.left-u.right,w=mn(g-u[x],v),b=mn(m-u[y],R),T=!t.middlewareData.shift;let E=w,S=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=R),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(E=v),T&&!d){const A=Qe(u.left,0),L=Qe(u.right,0),I=Qe(u.top,0),C=Qe(u.bottom,0);p?S=m-2*(A!==0||L!==0?A+L:Qe(u.left,u.right)):E=g-2*(I!==0||C!==0?I+C:Qe(u.top,u.bottom))}await c({...t,availableWidth:S,availableHeight:E});const O=await i.getDimensions(a.floating);return m!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function mf(e){const t=Ze(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Se(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:s,a=Bs(n)!==o||Bs(s)!==i;return a&&(n=o,s=i),{width:n,height:s,$:a}}function vi(e){return ve(e)?e:e.contextElement}function hn(e){const t=vi(e);if(!Se(t))return gt(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:o}=mf(t);let i=(o?Bs(n.width):n.width)/s,a=(o?Bs(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const zv=gt(0);function gf(e){const t=Ae(e);return!tr()||!t.visualViewport?zv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ae(e)?!1:t}function Zt(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=vi(e);let i=gt(1);t&&(s?ve(s)&&(i=hn(s)):i=hn(e));const a=Xv(o,n,s)?gf(o):gt(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(o){const d=Ae(o),p=s&&ve(s)?Ae(s):s;let m=d,g=mo(m);for(;g&&s&&p!==m;){const x=hn(g),y=g.getBoundingClientRect(),v=Ze(g),R=y.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,w=y.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,l*=x.y,u*=x.x,f*=x.y,c+=R,l+=w,m=Ae(g),g=mo(m)}}return Us({width:u,height:f,x:c,y:l})}function or(e,t){const n=nr(e).scrollLeft;return t?t.left+n:Zt(Rt(e)).left+n}function yf(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-or(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function qv(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const o=r==="fixed",i=Rt(s),a=t?er(t.floating):!1;if(s===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=gt(1);const u=gt(0),f=Se(s);if((f||!f&&!o)&&((Ut(s)!=="body"||Jt(i))&&(c=nr(s)),Se(s))){const p=Zt(s);l=hn(s),u.x=p.x+s.clientLeft,u.y=p.y+s.clientTop}const d=i&&!f&&!o?yf(i,c):gt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-c.scrollTop*l.y+u.y+d.y}}function Qv(e){return Array.from(e.getClientRects())}function Zv(e){const t=Rt(e),n=nr(e),s=e.ownerDocument.body,r=Qe(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=Qe(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let i=-n.scrollLeft+or(e);const a=-n.scrollTop;return Ze(s).direction==="rtl"&&(i+=Qe(t.clientWidth,s.clientWidth)-r),{width:r,height:o,x:i,y:a}}const wc=25;function Jv(e,t){const n=Ae(e),s=Rt(e),r=n.visualViewport;let o=s.clientWidth,i=s.clientHeight,a=0,c=0;if(r){o=r.width,i=r.height;const u=tr();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=or(s);if(l<=0){const u=s.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(s.clientWidth-f.clientWidth-p);m<=wc&&(o-=m)}else l<=wc&&(o+=l);return{width:o,height:i,x:a,y:c}}const eb=new Set(["absolute","fixed"]);function tb(e,t){const n=Zt(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,o=Se(e)?hn(e):gt(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=r*o.x,l=s*o.y;return{width:i,height:a,x:c,y:l}}function Sc(e,t,n){let s;if(t==="viewport")s=Jv(e,n);else if(t==="document")s=Zv(Rt(e));else if(ve(t))s=tb(t,n);else{const r=gf(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Us(s)}function vf(e,t){const n=bt(e);return n===t||!ve(n)||mt(n)?!1:Ze(n).position==="fixed"||vf(n,t)}function nb(e,t){const n=t.get(e);if(n)return n;let s=Dt(e,[],!1).filter(a=>ve(a)&&Ut(a)!=="body"),r=null;const o=Ze(e).position==="fixed";let i=o?bt(e):e;for(;ve(i)&&!mt(i);){const a=Ze(i),c=ii(i);!c&&a.position==="fixed"&&(r=null),(o?!c&&!r:!c&&a.position==="static"&&!!r&&eb.has(r.position)||Jt(i)&&!c&&vf(e,i))?s=s.filter(u=>u!==i):r=a,i=bt(i)}return t.set(e,s),s}function sb(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const i=[...n==="clippingAncestors"?er(t)?[]:nb(t,this._c):[].concat(n),s],a=i[0],c=i.reduce((l,u)=>{const f=Sc(t,u,r);return l.top=Qe(f.top,l.top),l.right=mn(f.right,l.right),l.bottom=mn(f.bottom,l.bottom),l.left=Qe(f.left,l.left),l},Sc(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function rb(e){const{width:t,height:n}=mf(e);return{width:t,height:n}}function ob(e,t,n){const s=Se(t),r=Rt(t),o=n==="fixed",i=Zt(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=gt(0);function l(){c.x=or(r)}if(s||!s&&!o)if((Ut(t)!=="body"||Jt(r))&&(a=nr(t)),s){const p=Zt(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else r&&l();o&&!s&&r&&l();const u=r&&!s&&!o?yf(r,a):gt(0),f=i.left+a.scrollLeft-c.x-u.x,d=i.top+a.scrollTop-c.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function Nr(e){return Ze(e).position==="static"}function Tc(e,t){if(!Se(e)||Ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rt(e)===n&&(n=n.ownerDocument.body),n}function bf(e,t){const n=Ae(e);if(er(e))return n;if(!Se(e)){let r=bt(e);for(;r&&!mt(r);){if(ve(r)&&!Nr(r))return r;r=bt(r)}return n}let s=Tc(e,t);for(;s&&xy(s)&&Nr(s);)s=Tc(s,t);return s&&mt(s)&&Nr(s)&&!ii(s)?n:s||Ey(e)||n}const ib=async function(e){const t=this.getOffsetParent||bf,n=this.getDimensions,s=await n(e.floating);return{reference:ob(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ab(e){return Ze(e).direction==="rtl"}const cb={convertOffsetParentRelativeRectToViewportRelativeRect:qv,getDocumentElement:Rt,getClippingRect:sb,getOffsetParent:bf,getElementRects:ib,getClientRects:Qv,getDimensions:rb,getScale:hn,isElement:ve,isRTL:ab};function xf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lb(e,t){let n=null,s;const r=Rt(e);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:f,width:d,height:p}=l;if(a||t(),!d||!p)return;const m=cn(f),g=cn(r.clientWidth-(u+d)),x=cn(r.clientHeight-(f+p)),y=cn(u),R={rootMargin:-m+"px "+-g+"px "+-x+"px "+-y+"px",threshold:Qe(0,mn(1,c))||1};let w=!0;function b(T){const E=T[0].intersectionRatio;if(E!==c){if(!w)return i();E?i(!1,E):s=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!xf(l,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(b,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(b,R)}n.observe(e)}return i(!0),o}function Ec(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=vi(e),u=r||o?[...l?Dt(l):[],...Dt(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=l&&a?lb(l,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(y=>{let[v]=y;v&&v.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var R;(R=p)==null||R.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,g=c?Zt(e):null;c&&x();function x(){const y=Zt(e);g&&!xf(g,y)&&n(),g=y,m=requestAnimationFrame(x)}return n(),()=>{var y;u.forEach(v=>{r&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),f?.(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const ub=Kv,fb=_v,db=Wv,hb=Gv,pb=Hv,mb=Yv,gb=(e,t,n)=>{const s=new Map,r={platform:cb,...n},o={...r.platform,_c:s};return Uv(e,t,{...r,platform:o})};var yb=typeof document<"u",vb=function(){},ws=yb?h.useLayoutEffect:vb;function _s(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!_s(e[s],t[s]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,r[s]))return!1;for(s=n;s--!==0;){const o=r[s];if(!(o==="_owner"&&e.$$typeof)&&!_s(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Rf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cc(e,t){const n=Rf(e);return Math.round(t*n)/n}function Br(e){const t=h.useRef(e);return ws(()=>{t.current=e}),t}function bb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=h.useState(s);_s(d,s)||p(s);const[m,g]=h.useState(null),[x,y]=h.useState(null),v=h.useCallback(P=>{P!==T.current&&(T.current=P,g(P))},[]),R=h.useCallback(P=>{P!==E.current&&(E.current=P,y(P))},[]),w=o||m,b=i||x,T=h.useRef(null),E=h.useRef(null),S=h.useRef(u),O=c!=null,A=Br(c),L=Br(r),I=Br(l),C=h.useCallback(()=>{if(!T.current||!E.current)return;const P={placement:t,strategy:n,middleware:d};L.current&&(P.platform=L.current),gb(T.current,E.current,P).then(B=>{const V={...B,isPositioned:I.current!==!1};N.current&&!_s(S.current,V)&&(S.current=V,yt.flushSync(()=>{f(V)}))})},[d,t,n,L,I]);ws(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const N=h.useRef(!1);ws(()=>(N.current=!0,()=>{N.current=!1}),[]),ws(()=>{if(w&&(T.current=w),b&&(E.current=b),w&&b){if(A.current)return A.current(w,b,C);C()}},[w,b,C,A,O]);const D=h.useMemo(()=>({reference:T,floating:E,setReference:v,setFloating:R}),[v,R]),j=h.useMemo(()=>({reference:w,floating:b}),[w,b]),k=h.useMemo(()=>{const P={position:n,left:0,top:0};if(!j.floating)return P;const B=Cc(j.floating,u.x),V=Cc(j.floating,u.y);return a?{...P,transform:"translate("+B+"px, "+V+"px)",...Rf(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:V}},[n,a,j.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:C,refs:D,elements:j,floatingStyles:k}),[u,C,D,j,k])}const xb=(e,t)=>({...ub(e),options:[e,t]}),Rb=(e,t)=>({...fb(e),options:[e,t]}),wb=(e,t)=>({...mb(e),options:[e,t]}),Sb=(e,t)=>({...db(e),options:[e,t]}),Tb=(e,t)=>({...hb(e),options:[e,t]}),Eb=(e,t)=>({...pb(e),options:[e,t]}),Cb={intentional:"onClick",sloppy:"onPointerDown"};function Pb(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function bi(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingElement"),o=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:d="sloppy",referencePress:p=!1,referencePressEvent:m="sloppy",ancestorScroll:g=!1,bubbles:x,externalTree:y}=t,v=Ht(y),R=X(typeof f=="function"?f:()=>!1),w=typeof f=="function"?R:f,b=h.useRef(!1),{escapeKey:T,outsidePress:E}=Pb(x),S=h.useRef(null),O=Ge(),A=Ge(),L=X(()=>{A.clear(),c.current.insideReactTree=!1}),I=h.useRef(!1),C=h.useRef(""),N=X(M=>{C.current=M.pointerType}),D=X(()=>{const M=C.current,te=M==="pen"||!M?"mouse":M,K=typeof d=="function"?d():d;return typeof K=="string"?K:K[te]}),j=X(M=>{if(!s||!l||!u||M.key!=="Escape"||I.current)return;const te=c.current.floatingContext?.nodeId,K=v?qt(v.nodesRef.current,te):[];if(!T&&K.length>0){let U=!0;if(K.forEach(z=>{z.context?.open&&!z.context.dataRef.current.__escapeKeyBubbles&&(U=!1)}),!U)return}const ye=By(M)?M.nativeEvent:M,F=ue(sr,ye);n.setOpen(!1,F),!T&&!F.isPropagationAllowed&&M.stopPropagation()}),k=X(M=>{const te=D();return te==="intentional"&&M.type!=="click"||te==="sloppy"&&M.type==="click"}),P=X(()=>{c.current.insideReactTree=!0,A.start(0,L)}),B=X((M,te=!1)=>{if(k(M)){L();return}if(c.current.insideReactTree){L();return}if(D()==="intentional"&&te||typeof w=="function"&&!w(M))return;const K=Ue(M),ye=`[${vn("inert")}]`,F=Me(n.select("floatingElement")).querySelectorAll(ye),U=n.context.triggerElements;if(K&&(U.hasElement(K)||U.hasMatchingElement(Z=>le(Z,K))))return;let z=ve(K)?K:null;for(;z&&!mt(z);){const Z=bt(z);if(mt(Z)||!ve(Z))break;z=Z}if(F.length&&ve(K)&&!Fy(K)&&!le(K,n.select("floatingElement"))&&Array.from(F).every(Z=>!le(z,Z)))return;if(Se(K)&&!("touches"in M)){const Z=mt(K),H=Ze(K),se=/auto|scroll/,G=Z||se.test(H.overflowX),me=Z||se.test(H.overflowY),xe=G&&K.clientWidth>0&&K.scrollWidth>K.clientWidth,Te=me&&K.clientHeight>0&&K.scrollHeight>K.clientHeight,we=H.direction==="rtl",Fe=Te&&(we?M.offsetX<=K.offsetWidth-K.clientWidth:M.offsetX>K.clientWidth),Le=xe&&M.offsetY>K.clientHeight;if(Fe||Le)return}const ne=c.current.floatingContext?.nodeId,de=v&&qt(v.nodesRef.current,ne).some(Z=>lt(M,Z.context?.elements.floating));if(lt(M,n.select("floatingElement"))||lt(M,n.select("domReferenceElement"))||de)return;const Q=v?qt(v.nodesRef.current,ne):[];if(Q.length>0){let Z=!0;if(Q.forEach(H=>{H.context?.open&&!H.context.dataRef.current.__outsidePressBubbles&&(Z=!1)}),!Z)return}n.setOpen(!1,ue(mi,M)),L()}),V=X(M=>{D()!=="sloppy"||M.pointerType==="touch"||!n.select("open")||!l||lt(M,n.select("floatingElement"))||lt(M,n.select("domReferenceElement"))||B(M)}),Y=X(M=>{if(D()!=="sloppy"||!n.select("open")||!l||lt(M,n.select("floatingElement"))||lt(M,n.select("domReferenceElement")))return;const te=M.touches[0];te&&(S.current={startTime:Date.now(),startX:te.clientX,startY:te.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{S.current&&(S.current.dismissOnTouchEnd=!1,S.current.dismissOnMouseDown=!1)}))}),ie=X(M=>{const te=Ue(M);function K(){Y(M),te?.removeEventListener(M.type,K)}te?.addEventListener(M.type,K)}),W=X(M=>{const te=b.current;if(b.current=!1,O.clear(),M.type==="mousedown"&&S.current&&!S.current.dismissOnMouseDown)return;const K=Ue(M);function ye(){M.type==="pointerdown"?V(M):B(M,te),K?.removeEventListener(M.type,ye)}K?.addEventListener(M.type,ye)}),ae=X(M=>{if(D()!=="sloppy"||!S.current||lt(M,n.select("floatingElement"))||lt(M,n.select("domReferenceElement")))return;const te=M.touches[0];if(!te)return;const K=Math.abs(te.clientX-S.current.startX),ye=Math.abs(te.clientY-S.current.startY),F=Math.sqrt(K*K+ye*ye);F>5&&(S.current.dismissOnTouchEnd=!0),F>10&&(B(M),O.clear(),S.current=null)}),fe=X(M=>{const te=Ue(M);function K(){ae(M),te?.removeEventListener(M.type,K)}te?.addEventListener(M.type,K)}),re=X(M=>{D()!=="sloppy"||!S.current||lt(M,n.select("floatingElement"))||lt(M,n.select("domReferenceElement"))||(S.current.dismissOnTouchEnd&&B(M),O.clear(),S.current=null)}),J=X(M=>{const te=Ue(M);function K(){re(M),te?.removeEventListener(M.type,K)}te?.addEventListener(M.type,K)});h.useEffect(()=>{if(!s||!l)return;c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=E;const M=new Bt;function te(z){n.setOpen(!1,ue(pi,z))}function K(){M.clear(),I.current=!0}function ye(){M.start(tr()?5:0,()=>{I.current=!1})}const F=Me(r);F.addEventListener("pointerdown",N,!0),u&&(F.addEventListener("keydown",j),F.addEventListener("compositionstart",K),F.addEventListener("compositionend",ye)),w&&(F.addEventListener("click",W,!0),F.addEventListener("pointerdown",W,!0),F.addEventListener("touchstart",ie,!0),F.addEventListener("touchmove",fe,!0),F.addEventListener("touchend",J,!0),F.addEventListener("mousedown",W,!0));let U=[];return g&&(ve(i)&&(U=Dt(i)),ve(r)&&(U=U.concat(Dt(r))),!ve(o)&&o&&o.contextElement&&(U=U.concat(Dt(o.contextElement)))),U=U.filter(z=>z!==F.defaultView?.visualViewport),U.forEach(z=>{z.addEventListener("scroll",te,{passive:!0})}),()=>{F.removeEventListener("pointerdown",N,!0),u&&(F.removeEventListener("keydown",j),F.removeEventListener("compositionstart",K),F.removeEventListener("compositionend",ye)),w&&(F.removeEventListener("click",W,!0),F.removeEventListener("pointerdown",W,!0),F.removeEventListener("touchstart",ie,!0),F.removeEventListener("touchmove",fe,!0),F.removeEventListener("touchend",J,!0),F.removeEventListener("mousedown",W,!0)),U.forEach(z=>{z.removeEventListener("scroll",te)}),M.clear(),b.current=!1}},[c,r,o,i,u,w,s,a,g,l,T,E,j,B,W,V,ie,fe,J,N,n]),h.useEffect(L,[w,L]);const ge=h.useMemo(()=>({onKeyDown:j,...p&&{[Cb[m]]:M=>{n.setOpen(!1,ue(Vt,M.nativeEvent))},...m!=="intentional"&&{onClick(M){n.setOpen(!1,ue(Vt,M.nativeEvent))}}}}),[j,n,p,m]),pe=X(M=>{const te=Ue(M.nativeEvent);!le(n.select("floatingElement"),te)||M.button!==0||(b.current=!0)}),oe=X(M=>{!s||!l||M.button!==0||(b.current=!0)}),he=h.useMemo(()=>({onKeyDown:j,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:P,onMouseDownCapture(M){P(),oe(M)},onPointerDownCapture(M){P(),oe(M)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[j,pe,P,oe]);return h.useMemo(()=>l?{reference:ge,floating:he,trigger:ge}:{},[l,ge,he])}var Ys=Symbol("NOT_FOUND");function Mb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ob(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ab(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var Pc=e=>Array.isArray(e)?e:[e];function Ib(e){const t=Array.isArray(e[0])?e[0]:e;return Ab(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Db(e,t){const n=[],{length:s}=e;for(let r=0;r<s;r++)n.push(e[r].apply(null,t));return n}function kb(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Ys},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Lb(e,t){let n=[];function s(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Ys}function r(a,c){s(a)===Ys&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function o(){return n}function i(){n=[]}return{get:s,put:r,getEntries:o,clear:i}}var Vb=(e,t)=>e===t;function Fb(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:r}=n;for(let o=0;o<r;o++)if(!e(n[o],s[o]))return!1;return!0}}function Nb(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=Vb,maxSize:r=1,resultEqualityCheck:o}=n,i=Fb(s);let a=0;const c=r<=1?kb(i):Lb(r,i);function l(){let u=c.get(arguments);if(u===Ys){if(u=e.apply(null,arguments),a++,o){const d=c.getEntries().find(p=>o(p.value,u));d&&(u=d.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Bb=class{constructor(e){this.value=e}deref(){return this.value}},jb=typeof WeakRef<"u"?WeakRef:Bb,Ub=0,Mc=1;function us(){return{s:Ub,v:void 0,o:null,p:null}}function wf(e,t={}){let n=us();const{resultEqualityCheck:s}=t;let r,o=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,d=c;f<d;f++){const p=arguments[f];if(typeof p=="function"||typeof p=="object"&&p!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const g=m.get(p);g===void 0?(a=us(),m.set(p,a)):a=g}else{let m=a.p;m===null&&(a.p=m=new Map);const g=m.get(p);g===void 0?(a=us(),m.set(p,a)):a=g}}const l=a;let u;if(a.s===Mc)u=a.v;else if(u=e.apply(null,arguments),o++,s){const f=r?.deref?.()??r;f!=null&&s(f,u)&&(u=f,o!==0&&o--),r=typeof u=="object"&&u!==null||typeof u=="function"?new jb(u):u}return l.s=Mc,l.v=u,u}return i.clearCache=()=>{n=us(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function Sf(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...r)=>{let o=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Mb(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:d=[],argsMemoize:p=wf,argsMemoizeOptions:m=[]}=u,g=Pc(d),x=Pc(m),y=Ib(r),v=f(function(){return o++,l.apply(null,arguments)},...g),R=p(function(){i++;const b=Db(y,arguments);return a=v.apply(null,b),a},...x);return Object.assign(R,{resultFunc:l,memoizedResultFunc:v,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:p})};return Object.assign(s,{withTypes:()=>s}),s}var Wb=Sf(wf),Hb=Object.assign((e,t=Wb)=>{Ob(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(o=>e[o]);return t(s,(...o)=>o.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Hb});Sf({memoize:Nb,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const q=(e,t,n,s,r,o,...i)=>{if(i.length>0)throw new Error(Je(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var $b=fd();const Kb=Wc(19),_b=Kb?Gb:zb;function Yb(e,t,n,s,r){return _b(e,t,n,s,r)}function Gb(e,t,n,s,r){const o=h.useCallback(()=>t(e.getSnapshot(),n,s,r),[e,t,n,s,r]);return $b.useSyncExternalStore(e.subscribe,o,o)}function zb(e,t,n,s,r){return dd.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,s,r))}class jn{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){jn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||jn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};jn.prototype.setState.call(this,t)}}class ir extends jn{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){h.useDebugValue(t),ee(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;ee(()=>(s.state[t]!==n&&s.set(t,n),()=>{s.set(t,void 0)}),[s,t,n])}useSyncedValues(t){const n=this,s=Object.values(t);ee(()=>{n.update(t)},[n,...s])}useControlledProp(t,n,s){h.useDebugValue(t);const r=this,o=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],s)&&super.setState({...this.state,[t]:s})),ee(()=>{o&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,s,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(t,n,s,r)=>{const o=this.selectors[t];return o(this.state,n,s,r)};useState=(t,n,s,r)=>{h.useDebugValue(t);const o=this.selectors[t];return Yb(this,o,n,s,r)};useContextCallback(t,n){h.useDebugValue(t);const s=X(n??Hc);this.context[t]=s}useStateSetter(t){const n=h.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let r=s(this.state);return n(r,r,this),this.subscribe(o=>{const i=s(o);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Xb={open:q(e=>e.open),domReferenceElement:q(e=>e.domReferenceElement),referenceElement:q(e=>e.positionReference??e.referenceElement),floatingElement:q(e=>e.floatingElement),floatingId:q(e=>e.floatingId)};class xi extends ir{constructor(t){const{nested:n,noEmit:s,onOpenChange:r,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ju(),nested:n,noEmit:s,triggerElements:o},Xb)}setOpen=(t,n)=>{if((!t||!this.state.open||Wu(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function qb(e,t=!1,n=!1){const[s,r]=h.useState(e&&t?"idle":void 0),[o,i]=h.useState(e);return e&&!o&&(i(!0),r("starting")),!e&&o&&s!=="ending"&&!n&&r("ending"),!e&&!o&&s==="ending"&&r(void 0),ee(()=>{if(!e&&o&&s!=="ending"&&n){const a=dt.request(()=>{r("ending")});return()=>{dt.cancel(a)}}},[e,o,s,n]),ee(()=>{if(!e||t)return;const a=dt.request(()=>{r(void 0)});return()=>{dt.cancel(a)}},[t,e]),ee(()=>{if(!e||!t)return;e&&o&&s!=="idle"&&r("starting");const a=dt.request(()=>{r("idle")});return()=>{dt.cancel(a)}},[t,e,o,r,s]),h.useMemo(()=>({mounted:o,setMounted:i,transitionStatus:s}),[o,s])}let _n=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Qb={[_n.startingStyle]:""},Zb={[_n.endingStyle]:""},ar={transitionStatus(e){return e==="starting"?Qb:e==="ending"?Zb:null}};function Jb(e,t=!1,n=!0){const s=rr();return X((r,o=null)=>{s.cancel();function i(){yt.flushSync(r)}const a=St(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=_n.startingStyle;if(!c.hasAttribute(f)){s.request(u);return}const d=new MutationObserver(()=>{c.hasAttribute(f)||(d.disconnect(),u())});d.observe(c,{attributes:!0,attributeFilter:[f]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{o?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(o?.aborted)return;i()}else f.length>0&&f.some(d=>d.pending||d.playState!=="finished")&&u()})};if(t){l();return}s.request(u)}})}function cr(e){const{enabled:t=!0,open:n,ref:s,onComplete:r}=e,o=X(r),i=Jb(s,n,!1);h.useEffect(()=>{if(!t)return;const a=new AbortController;return i(o,a.signal),()=>{a.abort()}},[t,n,o,i])}function ex(e,t){const n=h.useRef(null),s=h.useRef(null);return h.useCallback(r=>{if(e!==void 0){if(n.current!==null){const o=n.current,i=s.current,a=t.context.triggerElements.getById(o);i&&a===i&&t.context.triggerElements.delete(o),n.current=null,s.current=null}r!==null&&(n.current=e,s.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Tf(e,t,n,s){const r=n.useState("isMountedByTrigger",e),o=ex(e,n),i=X(a=>{if(o(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...s});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return ee(()=>{r&&n.update({activeTriggerElement:t.current,...s})},[r,n,t,...Object.values(s)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Ri(e){const t=e.useState("open");ee(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,r]=n.value;e.update({activeTriggerId:s,activeTriggerElement:r})}}},[t,e])}function wi(e,t,n){const{mounted:s,setMounted:r,transitionStatus:o}=qb(e);t.useSyncedValues({mounted:s,transitionStatus:o});const i=X(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return cr({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:o}}class Zn{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function tx(){return new xi({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Zn,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Si(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:tx(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:rt,inactiveTriggerProps:rt,popupProps:rt}}const Ti={open:q(e=>e.open),mounted:q(e=>e.mounted),transitionStatus:q(e=>e.transitionStatus),floatingRootContext:q(e=>e.floatingRootContext),preventUnmountingOnClose:q(e=>e.preventUnmountingOnClose),payload:q(e=>e.payload),activeTriggerId:q(e=>e.activeTriggerId),activeTriggerElement:q(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:q((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:q((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:q((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:q((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:q(e=>e.popupProps),popupElement:q(e=>e.popupElement),positionerElement:q(e=>e.positionerElement)};function nx(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,r=en(),o=Mt()!=null,i=it(()=>new xi({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new Zn,floatingId:r,nested:o,noEmit:e.noEmit||!1})).current;return ee(()=>{const a={open:t,floatingId:r};s.reference!==void 0&&(a.referenceElement=s.reference,a.domReferenceElement=ve(s.reference)?s.reference:null),s.floating!==void 0&&(a.floatingElement=s.floating),i.update(a)},[t,r,s.reference,s.floating,i]),i.context.onOpenChange=n,i.context.nested=o,i.context.noEmit=e.noEmit||!1,i}function sx(e={}){const{nodeId:t,externalTree:n}=e,s=nx(e),r=e.rootContext||s,o={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=h.useState(null),c=h.useRef(null),l=Ht(n);ee(()=>{o.domReference&&(c.current=o.domReference)},[o.domReference]);const u=bb({...e,elements:{...o,...i&&{reference:i}}}),f=h.useCallback(E=>{const S=ve(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;a(S),u.refs.setReference(S)},[u.refs]),[d,p]=h.useState(null),[m,g]=h.useState(null);r.useSyncedValue("referenceElement",d),r.useSyncedValue("domReferenceElement",ve(d)?d:null),r.useSyncedValue("floatingElement",m);const x=h.useCallback(E=>{(ve(E)||E===null)&&(c.current=E,p(E)),(ve(u.refs.reference.current)||u.refs.reference.current===null||E!==null&&!ve(E))&&u.refs.setReference(E)},[u.refs,p]),y=h.useCallback(E=>{g(E),u.refs.setFloating(E)},[u.refs]),v=h.useMemo(()=>({...u.refs,setReference:x,setFloating:y,setPositionReference:f,domReference:c}),[u.refs,x,y,f]),R=h.useMemo(()=>({...u.elements,domReference:o.domReference}),[u.elements,o.domReference]),w=r.useState("open"),b=r.useState("floatingId"),T=h.useMemo(()=>({...u,dataRef:r.context.dataRef,open:w,onOpenChange:r.setOpen,events:r.context.events,floatingId:b,refs:v,elements:R,nodeId:t,rootStore:r}),[u,v,R,t,r,w,b]);return ee(()=>{r.context.dataRef.current.floatingContext=T;const E=l?.nodesRef.current.find(S=>S.id===t);E&&(E.context=T)}),h.useMemo(()=>({...u,context:T,refs:v,elements:R,rootStore:r}),[u,v,R,T,r])}function Ei(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:r}=e,o=en(),i=Mt()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(s?"popupElement":"positionerElement"),u=t.context.triggerElements,f=it(()=>new xi({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:o,nested:i,noEmit:n})).current;return ee(()=>{const d={open:a,floatingId:o,referenceElement:c,floatingElement:l};ve(c)&&(d.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(d.positionReference=c),f.update(d)},[a,o,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const jr=Dy&&Lu;function Ef(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:s,dataRef:r}=n.context,{enabled:o=!0,visibleOnly:i=!0,delay:a}=t,c=h.useRef(!1),l=h.useRef(null),u=Ge(),f=h.useRef(!0);h.useEffect(()=>{const p=n.select("domReferenceElement");if(!o)return;const m=Ae(p);function g(){const v=n.select("domReferenceElement");!n.select("open")&&Se(v)&&v===ht(Me(v))&&(c.current=!0)}function x(){f.current=!0}function y(){f.current=!1}return m.addEventListener("blur",g),jr&&(m.addEventListener("keydown",x,!0),m.addEventListener("pointerdown",y,!0)),()=>{m.removeEventListener("blur",g),jr&&(m.removeEventListener("keydown",x,!0),m.removeEventListener("pointerdown",y,!0))}},[n,o]),h.useEffect(()=>{if(!o)return;function p(m){if(m.reason===Vt||m.reason===sr){const g=n.select("domReferenceElement");ve(g)&&(l.current=g,c.current=!0)}}return s.on("openchange",p),()=>{s.off("openchange",p)}},[s,o,n]);const d=h.useMemo(()=>({onMouseLeave(){c.current=!1,l.current=null},onFocus(p){const m=p.currentTarget;if(c.current){if(l.current===m)return;c.current=!1,l.current=null}const g=Ue(p.nativeEvent);if(i&&ve(g)){if(jr&&!p.relatedTarget){if(!f.current&&!ci(g))return}else if(!Ny(g))return}const x=p.relatedTarget&&n.context.triggerElements.hasElement(p.relatedTarget),{nativeEvent:y,currentTarget:v}=p,R=typeof a=="function"?a():a;if(n.select("open")&&x||R===0||R===void 0){n.setOpen(!0,ue(fn,y,v));return}u.start(R,()=>{c.current||n.setOpen(!0,ue(fn,y,v))})},onBlur(p){c.current=!1,l.current=null;const m=p.relatedTarget,g=p.nativeEvent,x=ve(m)&&m.hasAttribute(vn("focus-guard"))&&m.getAttribute("data-type")==="outside";u.start(0,()=>{const y=n.select("domReferenceElement"),v=ht(y?y.ownerDocument:document);if(!m&&v===y||le(r.current.floatingContext?.refs.floating.current,v)||le(y,v)||x)return;const R=m??v;if(ve(R)){const w=n.context.triggerElements;if(w.hasElement(R)||w.hasMatchingElement(b=>le(b,R)))return}n.setOpen(!1,ue(fn,g))})}}),[r,n,i,u,a]);return h.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}const So=vn("safe-polygon"),rx=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Bu}`;function ox(e){return e?!!e.closest(rx):!1}function Cf(e){const t=h.useRef(void 0),n=h.useRef(!1),s=h.useRef(void 0),r=h.useRef(!0),o=h.useRef(!1),i=h.useRef(()=>{}),a=h.useRef(!1),c=Ge(),l=Ge(),u=h.useRef(void 0);return h.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:s,blockMouseMoveRef:r,performedPointerEventsMutationRef:o,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,s,r,o,i,a,c,l,u])}const ix=new Set(["click","mousedown"]);function Pf(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:d,performedPointerEventsMutationRef:p,unbindMouseMoveRef:m,restTimeoutPendingRef:g,openChangeTimeout:x,handleCloseOptionsRef:y}=Cf(n),v=Ht(l),R=Mt(),w=X(()=>f.current?!0:i.current.openEvent?ix.has(i.current.openEvent.type):!1),b=X(()=>{const A=i.current.openEvent?.type;return A?.includes("mouse")&&A!=="mousedown"}),T=h.useCallback((A,L=!0)=>{const I=ax(c,u.current);I&&!d.current?x.start(I,()=>n.setOpen(!1,ue(We,A))):L&&(x.clear(),n.setOpen(!1,ue(We,A)))},[c,d,n,u,x]),E=X(()=>{m.current(),d.current=void 0}),S=X(()=>{if(p.current){const A=Me(r).body;A.style.pointerEvents="",A.removeAttribute(So),p.current=!1}}),O=X(A=>{const L=Ue(A);if(!ox(L)){f.current=!1;return}f.current=!0});ee(()=>{s||(u.current=void 0,g.current=!1,f.current=!1,E(),S())},[s,u,g,f,E,S]),h.useEffect(()=>()=>{E()},[E]),h.useEffect(()=>S,[S]),ee(()=>{if(a&&s&&y.current?.blockPointerEvents&&b()&&ve(o)&&r){p.current=!0;const A=Me(r).body;A.setAttribute(So,"");const L=o,I=r,C=v?.nodesRef.current.find(N=>N.id===R)?.context?.elements.floating;return C&&(C.style.pointerEvents=""),A.style.pointerEvents="none",L.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{A.style.pointerEvents="",L.style.pointerEvents="",I.style.pointerEvents=""}}},[a,s,o,r,y,b,v,R,p]),h.useEffect(()=>{if(!a)return;function A(N){if(w()||!i.current.floatingContext||!n.select("open"))return;const D=n.context.triggerElements;N.relatedTarget&&D.hasElement(N.relatedTarget)||(S(),E(),w()||T(N))}function L(N){x.clear(),S(),d.current?.(N),E()}function I(N){w()||T(N,!1)}const C=r;return C&&(C.addEventListener("mouseleave",A),C.addEventListener("mouseenter",L),C.addEventListener("mouseleave",I),C.addEventListener("pointerdown",O,!0)),()=>{C&&(C.removeEventListener("mouseleave",A),C.removeEventListener("mouseenter",L),C.removeEventListener("mouseleave",I),C.removeEventListener("pointerdown",O,!0))}})}function ax(e,t){return t&&!Qt(t)?0:typeof e=="function"?e():e}function Ur(e){return typeof e=="function"?e():e}const cx={current:null};function Mf(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:s,events:r}=n.context,{enabled:o=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=cx,externalTree:d,isActiveTrigger:p=!0}=t,m=Ht(d),{pointerTypeRef:g,interactedInsideRef:x,handlerRef:y,blockMouseMoveRef:v,performedPointerEventsMutationRef:R,unbindMouseMoveRef:w,restTimeoutPendingRef:b,openChangeTimeout:T,restTimeout:E,handleCloseOptionsRef:S}=Cf(n),O=je(a),A=je(i),L=je(l);p&&(S.current=O.current?.__options);const I=X(()=>x.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),C=h.useCallback((k,P=!0)=>{const B=xs(A.current,"close",g.current);B&&!y.current?T.start(B,()=>n.setOpen(!1,ue(We,k))):P&&(T.clear(),n.setOpen(!1,ue(We,k)))},[A,y,n,g,T]),N=X(()=>{w.current(),y.current=void 0}),D=X(()=>{if(R.current){const k=Me(n.select("domReferenceElement")).body;k.style.pointerEvents="",k.removeAttribute(So),R.current=!1}});h.useEffect(()=>{if(!o)return;function k(P){P.open||(T.clear(),E.clear(),v.current=!0,b.current=!1)}return r.on("openchange",k),()=>{r.off("openchange",k)}},[o,r,T,E,v,b]);const j=X(k=>{if(I()||!s.current.floatingContext)return;const P=n.context.triggerElements;if(k.relatedTarget&&P.hasElement(k.relatedTarget))return;const B=f.current;O.current?.({...s.current.floatingContext,tree:m,x:k.clientX,y:k.clientY,onClose(){D(),N(),!I()&&B===n.select("domReferenceElement")&&C(k)}})(k)});return h.useEffect(()=>{if(!o)return;const k=f.current??(p?n.select("domReferenceElement"):null);if(!ve(k))return;function P(Y){if(T.clear(),v.current=!1,c&&!Qt(g.current)||Ur(L.current)>0&&!xs(A.current,"open"))return;const ie=xs(A.current,"open",g.current),W=n.select("domReferenceElement"),ae=n.context.triggerElements,fe=(ae.hasElement(Y.target)||ae.hasMatchingElement(pe=>le(pe,Y.target)))&&(!W||!le(W,Y.target)),re=Y.currentTarget??null,J=n.select("open"),ge=!J||fe;fe&&J?n.setOpen(!0,ue(We,Y,re)):ie?T.start(ie,()=>{ge&&n.setOpen(!0,ue(We,Y,re))}):ge&&n.setOpen(!0,ue(We,Y,re))}function B(Y){if(I()){D();return}w.current();const ie=n.select("domReferenceElement"),W=Me(ie);E.clear(),b.current=!1;const ae=n.context.triggerElements;if(Y.relatedTarget&&ae.hasElement(Y.relatedTarget))return;if(O.current&&s.current.floatingContext){n.select("open")||T.clear();const re=f.current;y.current=O.current({...s.current.floatingContext,tree:m,x:Y.clientX,y:Y.clientY,onClose(){D(),N(),!I()&&re===n.select("domReferenceElement")&&C(Y,!0)}});const J=y.current;J(Y),W.addEventListener("mousemove",J),w.current=()=>{W.removeEventListener("mousemove",J)};return}(g.current!=="touch"||!le(n.select("floatingElement"),Y.relatedTarget))&&C(Y)}function V(Y){j(Y)}return n.select("open")&&k.addEventListener("mouseleave",V),u&&k.addEventListener("mousemove",P,{once:!0}),k.addEventListener("mouseenter",P),k.addEventListener("mouseleave",B),()=>{k.removeEventListener("mouseleave",V),u&&k.removeEventListener("mousemove",P),k.removeEventListener("mouseenter",P),k.removeEventListener("mouseleave",B)}},[N,D,v,s,A,C,n,o,O,j,p,I,c,u,g,L,E,b,T,f,m,w,y]),h.useMemo(()=>{function k(P){g.current=P.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(P){const{nativeEvent:B}=P,V=P.currentTarget,Y=n.select("domReferenceElement"),ie=n.context.triggerElements,W=n.select("open"),ae=(ie.hasElement(P.target)||ie.hasMatchingElement(re=>le(re,P.target)))&&(!Y||!le(Y,P.target));if(c&&!Qt(g.current)||W&&!ae||Ur(L.current)===0||!ae&&b.current&&P.movementX**2+P.movementY**2<2)return;E.clear();function fe(){if(b.current=!1,I())return;const re=n.select("open");!v.current&&(!re||ae)&&n.setOpen(!0,ue(We,B,V))}g.current==="touch"?yt.flushSync(()=>{fe()}):ae&&W?fe():(b.current=!0,E.start(Ur(L.current),fe))}}},[v,I,c,n,g,L,E,b])}function lr(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),s=e.map(l=>l?.item),r=e.map(l=>l?.trigger),o=h.useCallback(l=>fs(l,e,"reference"),t),i=h.useCallback(l=>fs(l,e,"floating"),n),a=h.useCallback(l=>fs(l,e,"item"),s),c=h.useCallback(l=>fs(l,e,"trigger"),r);return h.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[o,i,a,c])}function fs(e,t,n){const s=new Map,r=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[yo]="");for(const i in e)r&&e&&(i===Fu||i===Nu)||(o[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Oc(o,a,r,s)}return Oc(o,e,r,s),o}function Oc(e,t,n,s){for(const r in t){const o=t[r];n&&(r===Fu||r===Nu)||(r.startsWith("on")?(s.has(r)||s.set(r,[]),typeof o=="function"&&(s.get(r)?.push(o),e[r]=(...i)=>s.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=o)}}const lx="Escape";function ur(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ds(e,t){return ur(t,e===ai||e===qn,e===kt||e===Lt)}function Wr(e,t,n){return ur(t,e===qn,n?e===kt:e===Lt)||e==="Enter"||e===" "||e===""}function ux(e,t,n){return ur(t,n?e===kt:e===Lt,e===qn)}function fx(e,t,n,s){const r=n?e===Lt:e===kt,o=e===ai;return t==="both"||t==="horizontal"&&s&&s>1?e===lx:ur(t,r,o)}function dx(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingElement"),o=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:d=!1,loopFocus:p=!1,nested:m=!1,rtl:g=!1,virtual:x=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:R=!0,disabledIndices:w=void 0,orientation:b="vertical",parentOrientation:T,cols:E=1,scrollItemIntoView:S=!0,itemSizes:O,dense:A=!1,id:L,resetOnPointerLeave:I=!0,externalTree:C}=t,N=Ns(r),D=je(N),j=Mt(),k=Ht(C);ee(()=>{i.current.orientation=b},[i,b]);const P=vo(o),B=h.useRef(y),V=h.useRef(f??-1),Y=h.useRef(null),ie=h.useRef(!0),W=X(H=>{l(V.current===-1?null:V.current,H)}),ae=h.useRef(W),fe=h.useRef(!!r),re=h.useRef(s),J=h.useRef(!1),ge=h.useRef(!1),pe=je(w),oe=je(s),he=je(S),M=je(f),te=je(I),K=X(()=>{function H(xe){x?k?.events.emit("virtualfocus",xe):Rs(xe,{sync:J.current,preventScroll:!0})}const se=a.current[V.current],G=ge.current;se&&H(se),(J.current?xe=>xe():requestAnimationFrame)(()=>{const xe=a.current[V.current]||se;if(!xe)return;se||H(xe);const Te=he.current;Te&&F&&(G||!ie.current)&&xe.scrollIntoView?.(typeof Te=="boolean"?{block:"nearest",inline:"nearest"}:Te)})});ee(()=>{u&&(s&&r?(V.current=f??-1,B.current&&f!=null&&(ge.current=!0,W())):fe.current&&(V.current=-1,ae.current()))},[u,s,r,f,W]),ee(()=>{if(u){if(!s){J.current=!1;return}if(r)if(c==null){if(J.current=!1,M.current!=null)return;if(fe.current&&(V.current=-1,K()),(!re.current||!fe.current)&&B.current&&(Y.current!=null||B.current===!0&&Y.current==null)){let H=0;const se=()=>{a.current[0]==null?(H<2&&(H?requestAnimationFrame:queueMicrotask)(se),H+=1):(V.current=Y.current==null||Wr(Y.current,b,g)||m?Lr(a):lc(a),Y.current=null,W())};se()}}else Nn(a,c)||(V.current=c,K(),ge.current=!1)}},[u,s,r,c,M,m,a,b,g,W,K,pe]),ee(()=>{if(!u||r||!k||x||!fe.current)return;const H=k.nodesRef.current,se=H.find(xe=>xe.id===j)?.context?.elements.floating,G=ht(Me(r)),me=H.some(xe=>xe.context&&le(xe.context.elements.floating,G));se&&!me&&ie.current&&se.focus({preventScroll:!0})},[u,r,k,j,x]),ee(()=>{ae.current=W,re.current=s,fe.current=!!r}),ee(()=>{s||(Y.current=null,B.current=y)},[s,y]);const ye=c!=null,F=h.useMemo(()=>{function H(G){if(!oe.current)return;const me=a.current.indexOf(G.currentTarget);me!==-1&&V.current!==me&&(V.current=me,W(G))}return{onFocus(G){J.current=!0,H(G)},onClick:({currentTarget:G})=>G.focus({preventScroll:!0}),onMouseMove(G){J.current=!0,ge.current=!1,v&&H(G)},onPointerLeave(G){if(!oe.current||!ie.current||G.pointerType==="touch")return;J.current=!0;const me=G.relatedTarget;!v||a.current.includes(me)||te.current&&(V.current=-1,W(G),x||D.current?.focus({preventScroll:!0}))}}},[oe,D,v,a,W,te,x]),U=h.useCallback(()=>T??k?.nodesRef.current.find(H=>H.id===j)?.context?.dataRef?.current.orientation,[j,k,T]),z=X(H=>{if(ie.current=!1,J.current=!0,H.which===229||!oe.current&&H.currentTarget===D.current)return;if(m&&fx(H.key,b,g,E)){ds(H.key,U())||Be(H),n.setOpen(!1,ue(bs,H.nativeEvent)),Se(o)&&(x?k?.events.emit("virtualfocus",o):o.focus());return}const se=V.current,G=Lr(a,w),me=lc(a,w);if(P||(H.key==="Home"&&(Be(H),V.current=G,W(H)),H.key==="End"&&(Be(H),V.current=me,W(H))),E>1){const xe=O||Array.from({length:a.current.length},()=>({width:1,height:1})),Te=Qy(xe,E,A),we=Te.findIndex(Xe=>Xe!=null&&!Bn(a,Xe,w)),Fe=Te.reduce((Xe,at,ce)=>at!=null&&!Bn(a,at,w)?ce:Xe,-1),Le=Te[qy({current:Te.map(Xe=>Xe!=null?a.current[Xe]:null)},{event:H,orientation:b,loopFocus:p,rtl:g,cols:E,disabledIndices:Jy([...(typeof w!="function"?w:null)||a.current.map((Xe,at)=>Bn(a,at,w)?at:void 0),void 0],Te),minIndex:we,maxIndex:Fe,prevIndex:Zy(V.current>me?G:V.current,xe,Te,E,H.key===qn?"bl":H.key===(g?kt:Lt)?"tr":"tl"),stopEvent:!0})];if(Le!=null&&(V.current=Le,W(H)),b==="both")return}if(ds(H.key,b)){if(Be(H),s&&!x&&ht(H.currentTarget.ownerDocument)===H.currentTarget){V.current=Wr(H.key,b,g)?G:me,W(H);return}Wr(H.key,b,g)?p?se>=me?d&&se!==a.current.length?V.current=-1:(J.current=!1,V.current=G):V.current=Ne(a,{startingIndex:se,disabledIndices:w}):V.current=Math.min(me,Ne(a,{startingIndex:se,disabledIndices:w})):p?se<=G?d&&se!==-1?V.current=a.current.length:(J.current=!1,V.current=me):V.current=Ne(a,{startingIndex:se,decrement:!0,disabledIndices:w}):V.current=Math.max(G,Ne(a,{startingIndex:se,decrement:!0,disabledIndices:w})),Nn(a,V.current)&&(V.current=-1),W(H)}}),ne=h.useMemo(()=>x&&s&&ye&&{"aria-activedescendant":`${L}-${c}`},[x,s,ye,L,c]),de=h.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...P?{}:ne,onKeyDown(H){if(H.key==="Tab"&&H.shiftKey&&s&&!x){const se=Ue(H.nativeEvent);if(se&&!le(D.current,se))return;Be(H),n.setOpen(!1,ue(yn,H.nativeEvent)),Se(o)&&o.focus();return}z(H)},onPointerMove(){ie.current=!0}}),[ne,z,D,b,P,n,s,x,o]),Q=h.useMemo(()=>{function H(G){y==="auto"&&ju(G.nativeEvent)&&(B.current=!x)}function se(G){B.current=y,y==="auto"&&Uu(G.nativeEvent)&&(B.current=!0)}return{onKeyDown(G){const me=n.select("open");ie.current=!1;const xe=G.key.startsWith("Arrow"),Te=ux(G.key,U(),g),we=ds(G.key,b),Fe=(m?Te:we)||G.key==="Enter"||G.key.trim()==="";if(x&&me)return z(G);if(!(!me&&!R&&xe)){if(Fe){const Le=ds(G.key,U());Y.current=m&&Le?null:G.key}if(m){Te&&(Be(G),me?(V.current=Lr(a,pe.current),W(G)):n.setOpen(!0,ue(bs,G.nativeEvent,G.currentTarget)));return}we&&(M.current!=null&&(V.current=M.current),Be(G),!me&&R?n.setOpen(!0,ue(bs,G.nativeEvent,G.currentTarget)):z(G),me&&W(G))}},onFocus(G){n.select("open")&&!x&&(V.current=-1,W(G))},onPointerDown:se,onPointerEnter:se,onMouseDown:H,onClick:H}},[z,pe,y,a,m,W,n,R,b,U,g,M,x]),Z=h.useMemo(()=>({...ne,...Q}),[ne,Q]);return h.useMemo(()=>u?{reference:Z,floating:de,item:F,trigger:Q}:{},[u,Z,de,Q,F])}const hx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Of(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.useState("floatingId"),o=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=en(),u=o?.id||l,f=h.useMemo(()=>Ns(i)?.id||r,[i,r]),d=hx.get(c)??c,m=Mt()!=null,g=h.useMemo(()=>d==="tooltip"||c==="label"?rt:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[d,m,c]),x=h.useMemo(()=>d==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:s?f:void 0}:{...g,"aria-expanded":s?"true":"false","aria-controls":s?f:void 0,...d==="menu"&&{id:u}},[d,f,s,u,c,g]),y=h.useMemo(()=>{const R={id:f,...d&&{role:d}};return d==="tooltip"||c==="label"?R:{...R,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,c]),v=h.useCallback(({active:R,selected:w})=>{const b={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...b,"aria-selected":w}}return{}},[f,c]);return h.useMemo(()=>a?{reference:x,floating:y,item:v,trigger:g}:{},[a,x,y,g,v])}function px(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),r=n.context.dataRef,{listRef:o,activeIndex:i,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:f=750,ignoreKeys:d=Ps,selectedIndex:p=null}=t,m=Ge(),g=h.useRef(""),x=h.useRef(p??i??-1),y=h.useRef(null);ee(()=>{s&&(m.clear(),y.current=null,g.current="")},[s,m]),ee(()=>{s&&g.current===""&&(x.current=p??i??-1)},[s,p,i]);const v=X(T=>{T?r.current.typing||(r.current.typing=T,c?.(T)):r.current.typing&&(r.current.typing=T,c?.(T))}),R=X(T=>{function E(I,C,N){const D=u?u(C,N):C.find(j=>j?.toLocaleLowerCase().indexOf(N.toLocaleLowerCase())===0);return D?I.indexOf(D):-1}const S=o.current;if(g.current.length>0&&g.current[0]!==" "&&(E(S,S,g.current)===-1?v(!1):T.key===" "&&Be(T)),S==null||d.includes(T.key)||T.key.length!==1||T.ctrlKey||T.metaKey||T.altKey)return;s&&T.key!==" "&&(Be(T),v(!0)),S.every(I=>I?I[0]?.toLocaleLowerCase()!==I[1]?.toLocaleLowerCase():!0)&&g.current===T.key&&(g.current="",x.current=y.current),g.current+=T.key,m.start(f,()=>{g.current="",x.current=y.current,v(!1)});const A=x.current,L=E(S,[...S.slice((A||0)+1),...S.slice(0,(A||0)+1)],g.current);L!==-1?(a?.(L),y.current=L):T.key!==" "&&(g.current="",v(!1))}),w=h.useMemo(()=>({onKeyDown:R}),[R]),b=h.useMemo(()=>({onKeyDown:R,onKeyUp(T){T.key===" "&&v(!1)}}),[R,v]);return h.useMemo(()=>l?{reference:w,floating:b}:{},[l,w,b])}function Ac(e,t){const[n,s]=e;let r=!1;const o=t.length;for(let i=0,a=o-1;i<o;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=s!=f>=s&&n<=(u-c)*(s-l)/(f-l)+c&&(r=!r)}return r}function mx(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Af(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,r=new Bt;let o=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,d){const p=performance.now(),m=p-c;if(i===null||a===null||m===0)return i=f,a=d,c=p,null;const g=f-i,x=d-a,v=Math.sqrt(g*g+x*x)/m;return i=f,a=d,c=p,v}const u=({x:f,y:d,placement:p,elements:m,onClose:g,nodeId:x,tree:y})=>function(R){function w(){r.clear(),g()}if(r.clear(),!m.domReference||!m.floating||p==null||f==null||d==null)return;const{clientX:b,clientY:T}=R,E=[b,T],S=Ue(R),O=R.type==="mouseleave",A=le(m.floating,S),L=le(m.domReference,S),I=m.domReference.getBoundingClientRect(),C=m.floating.getBoundingClientRect(),N=p.split("-")[0],D=f>C.right-C.width/2,j=d>C.bottom-C.height/2,k=mx(E,I),P=C.width>I.width,B=C.height>I.height,V=(P?I:C).left,Y=(P?I:C).right,ie=(B?I:C).top,W=(B?I:C).bottom;if(A&&(o=!0,!O))return;if(L&&(o=!1),L&&!O){o=!0;return}if(O&&ve(R.relatedTarget)&&le(m.floating,R.relatedTarget)||y&&qt(y.nodesRef.current,x).some(({context:re})=>re?.open))return;if(N==="top"&&d>=I.bottom-1||N==="bottom"&&d<=I.top+1||N==="left"&&f>=I.right-1||N==="right"&&f<=I.left+1)return w();let ae=[];switch(N){case"top":ae=[[V,I.top+1],[V,C.bottom-1],[Y,C.bottom-1],[Y,I.top+1]];break;case"bottom":ae=[[V,C.top+1],[V,I.bottom-1],[Y,I.bottom-1],[Y,C.top+1]];break;case"left":ae=[[C.right-1,W],[C.right-1,ie],[I.left+1,ie],[I.left+1,W]];break;case"right":ae=[[I.right-1,W],[I.right-1,ie],[C.left+1,ie],[C.left+1,W]];break}function fe([re,J]){switch(N){case"top":{const ge=[P?re+t/2:D?re+t*4:re-t*4,J+t+1],pe=[P?re-t/2:D?re+t*4:re-t*4,J+t+1],oe=[[C.left,D||P?C.bottom-t:C.top],[C.right,D?P?C.bottom-t:C.top:C.bottom-t]];return[ge,pe,...oe]}case"bottom":{const ge=[P?re+t/2:D?re+t*4:re-t*4,J-t],pe=[P?re-t/2:D?re+t*4:re-t*4,J-t],oe=[[C.left,D||P?C.top+t:C.bottom],[C.right,D?P?C.top+t:C.bottom:C.top+t]];return[ge,pe,...oe]}case"left":{const ge=[re+t+1,B?J+t/2:j?J+t*4:J-t*4],pe=[re+t+1,B?J-t/2:j?J+t*4:J-t*4];return[...[[j||B?C.right-t:C.left,C.top],[j?B?C.right-t:C.left:C.right-t,C.bottom]],ge,pe]}case"right":{const ge=[re-t,B?J+t/2:j?J+t*4:J-t*4],pe=[re-t,B?J-t/2:j?J+t*4:J-t*4],oe=[[j||B?C.left+t:C.right,C.top],[j?B?C.left+t:C.right:C.left+t,C.bottom]];return[ge,pe,...oe]}default:return[]}}if(!Ac([b,T],ae)){if(o&&!k)return w();if(!O&&s){const re=l(R.clientX,R.clientY);if(re!==null&&re<.1)return w()}Ac([b,T],fe([f,d]))?!o&&s&&r.start(40,w):w()}};return u.__options={blockPointerEvents:n},u}const gx={...Ti,disabled:q(e=>e.disabled),instantType:q(e=>e.instantType),isInstantPhase:q(e=>e.isInstantPhase),trackCursorAxis:q(e=>e.trackCursorAxis),disableHoverablePopup:q(e=>e.disableHoverablePopup),lastOpenChangeReason:q(e=>e.openChangeReason),closeDelay:q(e=>e.closeDelay),hasViewport:q(e=>e.hasViewport)};class Ci extends ir{constructor(t){super({...yx(),...t},{popupRef:h.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Zn},gx)}setOpen=(t,n)=>{const s=n.reason,r=s===We,o=t&&s===fn,i=!t&&(s===Vt||s===sr);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const a=()=>{const c={open:t,openChangeReason:s};o?c.instantType="focus":i?c.instantType="dismiss":s===We&&(c.instantType=void 0);const l=n.trigger?.id??null;(l||t)&&(c.activeTriggerId=l,c.activeTriggerElement=n.trigger??null),this.update(c)};r?yt.flushSync(a):a()};static useStore(t,n){const s=it(()=>new Ci(n)).current,r=t??s,o=Ei({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=o,r}}function yx(){return{...Si(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}function vx(e){const{disabled:t=!1,defaultOpen:n=!1,open:s,disableHoverablePopup:r=!1,trackCursorAxis:o="none",actionsRef:i,onOpenChange:a,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:f=null,children:d}=e,p=Ci.useStore(l?.store,{open:s??n,activeTriggerId:u!==void 0?u:f});p.useControlledProp("open",s,n),p.useControlledProp("activeTriggerId",u,f),p.useContextCallback("onOpenChange",a),p.useContextCallback("onOpenChangeComplete",c);const m=p.useState("open"),g=!t&&m,x=p.useState("activeTriggerId"),y=p.useState("payload");p.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:r}),ee(()=>{m&&t&&p.setOpen(!1,ue(Tv))},[m,t,p]),p.useSyncedValue("disabled",t),Ri(p);const{forceUnmount:v,transitionStatus:R}=wi(g,p),w=p.useState("isInstantPhase"),b=p.useState("instantType"),T=p.useState("lastOpenChangeReason"),E=h.useRef(null);ee(()=>{R==="ending"&&T===pi||R!=="ending"&&w?(b!=="delay"&&(E.current=b),p.set("instantType","delay")):E.current!==null&&(p.set("instantType",E.current),E.current=null)},[R,w,T,b,p]),ee(()=>{g&&x==null&&p.set("payload",void 0)},[p,x,g]);const S=h.useCallback(()=>{p.setOpen(!1,bx(p,gi))},[p]);h.useImperativeHandle(i,()=>({unmount:v,close:S}),[v,S]);const O=p.useState("floatingRootContext"),A=Ef(O,{enabled:!t}),L=bi(O,{enabled:!t,referencePress:!0}),I=Bv(O,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),{getReferenceProps:C,getFloatingProps:N,getTriggerProps:D}=lr([A,L,I]),j=h.useMemo(()=>C(),[C]),k=h.useMemo(()=>D(),[D]),P=h.useMemo(()=>N(),[N]);return p.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:k,popupProps:P}),$.jsx(Mu.Provider,{value:p,children:typeof d=="function"?d({payload:y}):d})}function bx(e,t){const n=ue(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}let zt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_n.startingStyle]="startingStyle",e[e.endingStyle=_n.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),To=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xx={[To.popupOpen]:""},Rx={[To.popupOpen]:"",[To.pressed]:""},wx={[zt.open]:""},Sx={[zt.closed]:""},Tx={[zt.anchorHidden]:""},Ex={open(e){return e?xx:null}},Ic={open(e){return e?Rx:null}},En={open(e){return e?wx:Sx},anchorHidden(e){return e?Tx:null}};function Jn(e){return en(e,"base-ui")}const If=h.createContext(void 0);function Cx(){return h.useContext(If)}const Px=600,Mx=h.forwardRef(function(t,n){const{className:s,render:r,handle:o,payload:i,disabled:a,delay:c,closeDelay:l,id:u,...f}=t,d=Zs(!0),p=o?.store??d;if(!p)throw new Error(Je(82));const m=Jn(u),g=p.useState("isTriggerActive",m),x=p.useState("isOpenedByTrigger",m),y=p.useState("floatingRootContext"),v=h.useRef(null),R=c??Px,w=l??0,{registerTrigger:b,isMountedByThisTrigger:T}=Tf(m,v,p,{payload:i,closeDelay:w}),E=Cx(),{delayRef:S,isInstantPhase:O,hasProvider:A}=Cv(y,{open:x});p.useSyncedValue("isInstantPhase",O);const L=p.useState("disabled"),I=a??L,C=p.useState("trackCursorAxis"),N=p.useState("disableHoverablePopup"),D=Mf(y,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!N&&C!=="both"?Af():null,restMs(){const B=E?.delay,V=typeof S.current=="object"?S.current.open:void 0;let Y=R;return A&&(V!==0?Y=c??B??R:Y=0),Y},delay(){const B=typeof S.current=="object"?S.current.close:void 0;let V=w;return l==null&&A&&(V=B),{close:V}},triggerElementRef:v,isActiveTrigger:g}),j=h.useMemo(()=>({open:x}),[x]),k=p.useState("triggerProps",T);return ze("button",t,{state:j,ref:[n,b,v],props:[D,k,{id:m},f],stateAttributesMapping:Ex})}),Df=h.createContext(void 0);function Ox(){const e=h.useContext(Df);if(e===void 0)throw new Error(Je(70));return e}const Ax=h.forwardRef(function(t,n){const{children:s,container:r,className:o,render:i,...a}=t,{portalNode:c,portalSubtree:l}=ff({container:r,ref:n,componentProps:t,elementProps:a});return!l&&!c?null:$.jsxs(h.Fragment,{children:[l,c&&yt.createPortal(s,c)]})}),Ix=h.forwardRef(function(t,n){const{keepMounted:s=!1,...r}=t;return Zs().useState("mounted")||s?$.jsx(Df.Provider,{value:s,children:$.jsx(Ax,{ref:n,...r})}):null}),kf=h.createContext(void 0);function Dx(){const e=h.useContext(kf);if(e===void 0)throw new Error(Je(71));return e}const kx=h.createContext(void 0);function Lf(){return h.useContext(kx)?.direction??"ltr"}const Lx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=Ct(e,t)||{};if(l==null)return{};const d=Hu(u),p={x:n,y:s},m=fi(r),g=ui(m),x=await i.getDimensions(l),y=m==="y",v=y?"top":"left",R=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[g]+o.reference[m]-p[m]-o.floating[g],T=p[m]-o.reference[m],E=f==="real"?await i.getOffsetParent?.(l):a.floating;let S=a.floating[w]||o.floating[g];(!S||!await i.isElement?.(E))&&(S=a.floating[w]||o.floating[g]);const O=b/2-T/2,A=S/2-x[g]/2-1,L=Math.min(d[v],A),I=Math.min(d[R],A),C=L,N=S-x[g]-I,D=S/2-x[g]/2+O,j=bo(C,D,N),k=!c.arrow&&Wt(r)!=null&&D!==j&&o.reference[g]/2-(D<C?L:I)-x[g]/2<0,P=k?D<C?D-C:D-N:0;return{[m]:p[m]+P,data:{[m]:j,centerOffset:D-j-P,...k&&{alignmentOffset:P}},reset:k}}}),Vx=(e,t)=>({...Lx(e),options:[e,t]}),Fx={name:"hide",async fn(e){const{width:t,height:n,x:s,y:r}=e.rects.reference,o=t===0&&n===0&&s===0&&r===0;return{data:{referenceHidden:(await Eb().fn(e)).data?.referenceHidden||o}}}},Ss={sideX:"left",sideY:"top"},Nx={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:r},platform:o,strategy:i,placement:a}=e,c=Ae(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Ss};const f=await o.getOffsetParent?.(r);let d={width:0,height:0};if(i==="fixed"&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const v=xt(r);d={width:v.documentElement.clientWidth,height:v.documentElement.clientHeight}}else await o.isElement?.(f)&&(d=await o.getDimensions(f));const p=Ye(a);let m=t,g=n;p==="left"&&(m=d.width-(t+s.width)),p==="top"&&(g=d.height-(n+s.height));const x=p==="left"?"right":Ss.sideX,y=p==="top"?"bottom":Ss.sideY;return{x:m,y:g,data:{sideX:x,sideY:y}}}};function Vf(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function Dc(e,t,n){const{rects:s,placement:r}=e;return{side:Vf(t,Ye(r),n),align:Wt(r)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function Ff(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:r=0,align:o="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:d=!1,floatingRootContext:p,mounted:m,collisionAvoidance:g,shiftCrossAxis:x=!1,nodeId:y,adaptiveOrigin:v,lazyFlip:R=!1,externalTree:w}=e,[b,T]=h.useState(null);!m&&b!==null&&T(null);const E=g.side||"flip",S=g.align||"flip",O=g.fallbackAxisSide||"end",A=typeof t=="function"?t:void 0,L=X(A),I=A?L:t,C=je(t),D=Lf()==="rtl",j=b||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":D?"left":"right","inline-start":D?"right":"left"}[s],k=o==="center"?j:`${j}-${o}`;let P=c;const B=1,V=s==="bottom"?B:0,Y=s==="top"?B:0,ie=s==="right"?B:0,W=s==="left"?B:0;typeof P=="number"?P={top:P+V,right:P+W,bottom:P+Y,left:P+ie}:P&&(P={top:(P.top||0)+V,right:(P.right||0)+W,bottom:(P.bottom||0)+Y,left:(P.left||0)+ie});const ae={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:P},fe=h.useRef(null),re=je(r),J=je(i),oe=[xb(Ce=>{const Ie=Dc(Ce,s,D),qe=typeof re.current=="function"?re.current(Ie):re.current,_e=typeof J.current=="function"?J.current(Ie):J.current;return{mainAxis:qe,crossAxis:_e,alignmentAxis:_e}},[typeof r!="function"?r:0,typeof i!="function"?i:0,D,s])],he=S==="none"&&E!=="shift",M=!he&&(l||x||E==="shift"),te=E==="none"?null:Sb({...ae,padding:{top:P.top+B,right:P.right+B,bottom:P.bottom+B,left:P.left+B},mainAxis:!x&&E==="flip",crossAxis:S==="flip"?"alignment":!1,fallbackAxisSideDirection:O}),K=he?null:Rb(Ce=>{const Ie=xt(Ce.elements.floating).documentElement;return{...ae,rootBoundary:x?{x:0,y:0,width:Ie.clientWidth,height:Ie.clientHeight}:void 0,mainAxis:S!=="none",crossAxis:M,limiter:l||x?void 0:wb(qe=>{if(!fe.current)return{};const{width:_e,height:wt}=fe.current.getBoundingClientRect(),et=st(Ye(qe.placement)),$t=et==="y"?_e:wt,pr=et==="y"?P.left+P.right:P.top+P.bottom;return{offset:$t/2+pr/2}})}},[ae,l,x,P,S]);E==="shift"||S==="shift"||o==="center"?oe.push(K,te):oe.push(te,K),oe.push(Tb({...ae,apply({elements:{floating:Ce},rects:{reference:Ie},availableWidth:qe,availableHeight:_e}){Object.entries({"--available-width":`${qe}px`,"--available-height":`${_e}px`,"--anchor-width":`${Ie.width}px`,"--anchor-height":`${Ie.height}px`}).forEach(([wt,et])=>{Ce.style.setProperty(wt,et)})}}),Vx(()=>({element:fe.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(Ce){const{elements:Ie,middlewareData:qe,placement:_e,rects:wt,y:et}=Ce,$t=Ye(_e),pr=st($t),Vi=fe.current,Zf=qe.arrow?.x||0,Jf=qe.arrow?.y||0,ed=Vi?.clientWidth||0,td=Vi?.clientHeight||0,mr=Zf+ed/2,Fi=Jf+td/2,nd=Math.abs(qe.shift?.y||0),sd=wt.reference.height/2,Cn=typeof r=="function"?r(Dc(Ce,s,D)):r,rd=nd>Cn,od={top:`${mr}px calc(100% + ${Cn}px)`,bottom:`${mr}px ${-Cn}px`,left:`calc(100% + ${Cn}px) ${Fi}px`,right:`${-Cn}px ${Fi}px`}[$t],id=`${mr}px ${wt.reference.y+sd-et}px`;return Ie.floating.style.setProperty("--transform-origin",M&&pr==="y"&&rd?id:od),{}}},Fx,v),ee(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);const ye=h.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:F,elements:U,x:z,y:ne,middlewareData:de,update:Q,placement:Z,context:H,isPositioned:se,floatingStyles:G}=sx({rootContext:p,placement:k,middleware:oe,strategy:n,whileElementsMounted:d?void 0:(...Ce)=>Ec(...Ce,ye),nodeId:y,externalTree:w}),{sideX:me,sideY:xe}=de.adaptiveOrigin||Ss,Te=se?n:"fixed",we=h.useMemo(()=>v?{position:Te,[me]:z,[xe]:ne}:{position:Te,...G},[v,Te,me,z,xe,ne,G]),Fe=h.useRef(null);ee(()=>{if(!m)return;const Ce=C.current,Ie=typeof Ce=="function"?Ce():Ce,_e=(kc(Ie)?Ie.current:Ie)||null||null;_e!==Fe.current&&(F.setPositionReference(_e),Fe.current=_e)},[m,F,I,C]),h.useEffect(()=>{if(!m)return;const Ce=C.current;typeof Ce!="function"&&kc(Ce)&&Ce.current!==Fe.current&&(F.setPositionReference(Ce.current),Fe.current=Ce.current)},[m,F,I,C]),h.useEffect(()=>{if(d&&m&&U.domReference&&U.floating)return Ec(U.domReference,U.floating,Q,ye)},[d,m,U,Q,ye]);const Le=Ye(Z),Xe=Vf(s,Le,D),at=Wt(Z)||"center",ce=!!de.hide?.referenceHidden;ee(()=>{R&&m&&se&&T(Le)},[R,m,se,Le]);const be=h.useMemo(()=>({position:"absolute",top:de.arrow?.y,left:de.arrow?.x}),[de.arrow]),ke=de.arrow?.centerOffset!==0;return h.useMemo(()=>({positionerStyles:we,arrowStyles:be,arrowRef:fe,arrowUncentered:ke,side:Xe,align:at,physicalSide:Le,anchorHidden:ce,refs:F,context:H,isPositioned:se,update:Q}),[we,be,fe,ke,Xe,at,Le,ce,F,H,se,Q])}function kc(e){return e!=null&&"current"in e}function Pi(e){return e==="starting"?Id:rt}const Bx=h.forwardRef(function(t,n){const{render:s,className:r,anchor:o,positionMethod:i="absolute",side:a="top",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:x=Kc,...y}=t,v=Zs(),R=Ox(),w=v.useState("open"),b=v.useState("mounted"),T=v.useState("trackCursorAxis"),E=v.useState("disableHoverablePopup"),S=v.useState("floatingRootContext"),O=v.useState("instantType"),A=v.useState("transitionStatus"),L=v.useState("hasViewport"),I=Ff({anchor:o,positionMethod:i,floatingRootContext:S,mounted:b,side:a,sideOffset:l,align:c,alignOffset:u,collisionBoundary:f,collisionPadding:d,sticky:m,arrowPadding:p,disableAnchorTracking:g,keepMounted:R,collisionAvoidance:x,adaptiveOrigin:L?Nx:void 0}),C=h.useMemo(()=>{const k={};return(!w||T==="both"||E)&&(k.pointerEvents="none"),{role:"presentation",hidden:!b,style:{...I.positionerStyles,...k}}},[w,T,E,b,I.positionerStyles]),N=h.useMemo(()=>({open:w,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:T!=="none"?"tracking-cursor":O}),[w,I.side,I.align,I.anchorHidden,T,O]),D=h.useMemo(()=>({...N,arrowRef:I.arrowRef,arrowStyles:I.arrowStyles,arrowUncentered:I.arrowUncentered}),[N,I.arrowRef,I.arrowStyles,I.arrowUncentered]),j=ze("div",t,{state:N,props:[C,Pi(A),y],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:En});return $.jsx(kf.Provider,{value:D,children:j})}),jx={...En,...ar},Ux=h.forwardRef(function(t,n){const{className:s,render:r,...o}=t,i=Zs(),{side:a,align:c}=Dx(),l=i.useState("open"),u=i.useState("instantType"),f=i.useState("transitionStatus"),d=i.useState("popupProps"),p=i.useState("floatingRootContext");cr({open:l,ref:i.context.popupRef,onComplete(){l&&i.context.onOpenChangeComplete?.(!0)}});const m=i.useState("disabled"),g=i.useState("closeDelay");Pf(p,{enabled:!m,closeDelay:g});const x=h.useMemo(()=>({open:l,side:a,align:c,instant:u,transitionStatus:f}),[l,a,c,u,f]);return ze("div",t,{state:x,ref:[n,i.context.popupRef,i.useStateSetter("popupElement")],props:[d,Pi(f),o],stateAttributesMapping:jx})}),Wx=function(t){const{delay:n,closeDelay:s,timeout:r=400}=t,o=h.useMemo(()=>({delay:n,closeDelay:s}),[n,s]),i=h.useMemo(()=>({open:n,close:s}),[n,s]);return $.jsx(If.Provider,{value:o,children:$.jsx(Ev,{delay:i,timeoutMs:r,children:t.children})})};function Nf(e){return Wc(19)?e:e?"true":void 0}function lw({children:e}){return $.jsx(Wx,{delay:0,closeDelay:0,timeout:0,children:e})}function uw({children:e,...t}){return $.jsx(vx,{...t,children:e})}function fw({className:e,...t}){return $.jsx(Mx,{className:Pt(e),...t})}function dw({className:e,side:t="top",children:n}){return $.jsx(Ix,{children:$.jsx(Bx,{side:t,children:$.jsx(Ux,{className:Pt("rounded-md border border-primary-900 bg-primary-950 px-2 py-1 text-xs text-primary-50 shadow-sm",e),children:n})})})}const Bf=h.createContext(void 0);function tn(e){const t=h.useContext(Bf);if(e===!1&&t===void 0)throw new Error(Je(27));return t}const Hx={...En,...ar},$x=h.forwardRef(function(t,n){const{render:s,className:r,forceRender:o=!1,...i}=t,{store:a}=tn(),c=a.useState("open"),l=a.useState("nested"),u=a.useState("mounted"),f=a.useState("transitionStatus"),d=h.useMemo(()=>({open:c,transitionStatus:f}),[c,f]);return ze("div",t,{state:d,ref:[a.context.backdropRef,n],stateAttributesMapping:Hx,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:o||!l})}),Kx=h.createContext(void 0);function Mi(e=!1){const t=h.useContext(Kx);if(t===void 0&&!e)throw new Error(Je(16));return t}function _x(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:r=0,isNativeButton:o}=e,i=s&&t!==!1,a=s&&t===!1;return{props:h.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return s||(l.tabIndex=r,!o&&n&&(l.tabIndex=t?r:-1)),(o&&(t||i)||!o&&n)&&(l["aria-disabled"]=n),o&&(!t||a)&&(l.disabled=n),l},[s,n,t,i,a,o,r])}}function Oi(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:r=!0}=e,o=h.useRef(null),i=Mi(!0)!==void 0,a=X(()=>{const d=o.current;return!!(d?.tagName==="A"&&d?.href)}),{props:c}=_x({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:s,isNativeButton:r}),l=h.useCallback(()=>{const d=o.current;Yx(d)&&i&&t&&c.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,c.disabled,i]);ee(l,[l]);const u=h.useCallback((d={})=>{const{onClick:p,onMouseDown:m,onKeyUp:g,onKeyDown:x,onPointerDown:y,...v}=d;return Ms({type:r?"button":void 0,onClick(w){if(t){w.preventDefault();return}p?.(w)},onMouseDown(w){t||m?.(w)},onKeyDown(w){if(t||(Wi(w),x?.(w)),w.baseUIHandlerPrevented)return;const b=w.target===w.currentTarget&&!r&&!a()&&!t,T=w.key==="Enter",E=w.key===" ";b&&((E||T)&&w.preventDefault(),T&&p?.(w))},onKeyUp(w){t||(Wi(w),g?.(w)),!w.baseUIHandlerPrevented&&w.target===w.currentTarget&&!r&&!t&&w.key===" "&&p?.(w)},onPointerDown(w){if(t){w.preventDefault();return}y?.(w)}},r?void 0:{role:"button"},c,v)},[t,c,r,a]),f=X(d=>{o.current=d,l()});return{getButtonProps:u,buttonRef:f}}function Yx(e){return Se(e)&&e.tagName==="BUTTON"}const Gx=h.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,...a}=t,{store:c}=tn(),l=c.useState("open");function u(m){l&&c.setOpen(!1,ue(wv,m.nativeEvent))}const{getButtonProps:f,buttonRef:d}=Oi({disabled:o,native:i}),p=h.useMemo(()=>({disabled:o}),[o]);return ze("button",t,{state:p,ref:[n,d],props:[{onClick:u},a,f]})}),zx=h.forwardRef(function(t,n){const{render:s,className:r,id:o,...i}=t,{store:a}=tn(),c=Jn(o);return a.useSyncedValueWithCleanup("descriptionElementId",c),ze("p",t,{ref:n,props:[{id:c},i]})});let Xx=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),qx=(function(e){return e[e.open=zt.open]="open",e[e.closed=zt.closed]="closed",e[e.startingStyle=zt.startingStyle]="startingStyle",e[e.endingStyle=zt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const jf=h.createContext(void 0);function Qx(){const e=h.useContext(jf);if(e===void 0)throw new Error(Je(26));return e}const Ai="ArrowUp",Ii="ArrowDown",Di="ArrowLeft",ki="ArrowRight",fr="Home",dr="End",Zx=new Set([Di,ki]),hw=new Set([Di,ki,fr,dr]),Jx=new Set([Ai,Ii]),pw=new Set([Ai,Ii,fr,dr]),eR=new Set([...Zx,...Jx]),mw=new Set([...eR,fr,dr]),Uf=new Set([Ai,Ii,Di,ki,fr,dr]),tR="Shift",nR="Control",sR="Alt",rR="Meta",gw=new Set([tR,nR,sR,rR]);function oR(e){return Se(e)&&e.tagName==="INPUT"}function yw(e){return!!(oR(e)&&e.selectionStart!=null||Se(e)&&e.tagName==="TEXTAREA")}function vw(e,t,n,s){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,o=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&s!=="vertical"){const c=Lc(e,t,"left"),l=hs(e),u=hs(t);n==="ltr"&&(c+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight?r=c+t.offsetWidth+u.scrollMarginRight-e.clientWidth+l.scrollPaddingRight:c-u.scrollMarginLeft<e.scrollLeft+l.scrollPaddingLeft&&(r=c-u.scrollMarginLeft-l.scrollPaddingLeft)),n==="rtl"&&(c-u.scrollMarginRight<e.scrollLeft+l.scrollPaddingLeft?r=c-u.scrollMarginLeft-l.scrollPaddingLeft:c+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight&&(r=c+t.offsetWidth+u.scrollMarginRight-e.clientWidth+l.scrollPaddingRight))}if(a&&s!=="horizontal"){const c=Lc(e,t,"top"),l=hs(e),u=hs(t);c-u.scrollMarginTop<e.scrollTop+l.scrollPaddingTop?o=c-u.scrollMarginTop-l.scrollPaddingTop:c+t.offsetHeight+u.scrollMarginBottom>e.scrollTop+e.clientHeight-l.scrollPaddingBottom&&(o=c+t.offsetHeight+u.scrollMarginBottom-e.clientHeight+l.scrollPaddingBottom)}e.scrollTo({left:r,top:o,behavior:"auto"})}function Lc(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[s],t.offsetParent!==e);)t=t.offsetParent;return r}function hs(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const iR={...En,...ar,nestedDialogOpen(e){return e?{[qx.nestedDialogOpen]:""}:null}},aR=h.forwardRef(function(t,n){const{className:s,finalFocus:r,initialFocus:o,render:i,...a}=t,{store:c}=tn(),l=c.useState("descriptionElementId"),u=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),d=c.useState("popupProps"),p=c.useState("modal"),m=c.useState("mounted"),g=c.useState("nested"),x=c.useState("nestedOpenDialogCount"),y=c.useState("open"),v=c.useState("openMethod"),R=c.useState("titleElementId"),w=c.useState("transitionStatus"),b=c.useState("role");Qx(),cr({open:y,ref:c.context.popupRef,onComplete(){y&&c.context.onOpenChangeComplete?.(!0)}});function T(L){return L==="touch"?c.context.popupRef.current:!0}const E=o===void 0?T:o,S=x>0,O=h.useMemo(()=>({open:y,nested:g,transitionStatus:w,nestedDialogOpen:S}),[y,g,w,S]),A=ze("div",t,{state:O,props:[d,{"aria-labelledby":R??void 0,"aria-describedby":l??void 0,role:b,tabIndex:-1,hidden:!m,onKeyDown(L){Uf.has(L.key)&&L.stopPropagation()},style:{[Xx.nestedDialogs]:x}},a],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:iR});return $.jsx(hf,{context:f,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:E,returnFocus:r,modal:p!==!1,restoreFocus:"popup",children:A})}),Wf=h.forwardRef(function(t,n){const{cutout:s,...r}=t;let o;if(s){const i=s?.getBoundingClientRect();o=`polygon(
|
|
10
|
+
0% 0%,
|
|
11
|
+
100% 0%,
|
|
12
|
+
100% 100%,
|
|
13
|
+
0% 100%,
|
|
14
|
+
0% 0%,
|
|
15
|
+
${i.left}px ${i.top}px,
|
|
16
|
+
${i.left}px ${i.bottom}px,
|
|
17
|
+
${i.right}px ${i.bottom}px,
|
|
18
|
+
${i.right}px ${i.top}px,
|
|
19
|
+
${i.left}px ${i.top}px
|
|
20
|
+
)`}return $.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),cR=h.forwardRef(function(t,n){const{keepMounted:s=!1,...r}=t,{store:o}=tn(),i=o.useState("mounted"),a=o.useState("modal"),c=o.useState("open");return i||s?$.jsx(jf.Provider,{value:s,children:$.jsxs(df,{ref:n,...r,children:[i&&a===!0&&$.jsx(Wf,{ref:o.context.internalBackdropRef,inert:Nf(!c)}),t.children]})}):null});let Vc={},Fc={},Nc="";function lR(e){if(typeof document>"u")return!1;const t=xt(e);return Ae(t).innerWidth-t.documentElement.clientWidth>0}function uR(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=xt(e).documentElement,r={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY};s.style.scrollbarGutter="stable",s.style.overflowY="scroll";const o=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return Object.assign(s.style,r),o===i}function fR(e){const t=xt(e),n=t.documentElement,s=t.body,r=Jt(n)?n:s,o=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=o}}function dR(e){const t=xt(e),n=t.documentElement,s=t.body,r=Ae(n);let o=0,i=0,a=!1;const c=dt.create();if(Iy&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const d=r.getComputedStyle(n),p=r.getComputedStyle(s),x=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Vc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nc=n.style.scrollBehavior,Fc={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,R=d.overflowY==="scroll"||p.overflowY==="scroll",w=d.overflowX==="scroll"||p.overflowX==="scroll",b=Math.max(0,r.innerWidth-s.clientWidth),T=Math.max(0,r.innerHeight-s.clientHeight),E=parseFloat(p.marginTop)+parseFloat(p.marginBottom),S=parseFloat(p.marginLeft)+parseFloat(p.marginRight),O=Jt(n)?n:s;if(a=uR(e),a){n.style.scrollbarGutter=x,O.style.overflowY="hidden",O.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:x,overflowY:"hidden",overflowX:"hidden"}),(y||R)&&(n.style.overflowY="scroll"),(v||w)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:E||T?`calc(100dvh - ${E+T}px)`:"100dvh",width:S||b?`calc(100vw - ${S+b}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=o,s.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Vc),Object.assign(s.style,Fc),a||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Nc)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class hR{lockCount=0;restore=null;timeoutLock=Bt.create();timeoutUnlock=Bt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=xt(t).documentElement,r=Ae(s).getComputedStyle(s).overflowY;if(r==="hidden"||r==="clip"){this.restore=Hc;return}const o=ku||!lR(t);this.restore=o?fR(t):dR(t)}}const pR=new hR;function Hf(e=!0,t=null){ee(()=>{if(e)return pR.acquire(t)},[e,t])}function mR(e){const t=h.useRef(""),n=h.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:h.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function $f(e){const[t,n]=h.useState(null),s=X((a,c)=>{e||n(c||(ku?"touch":""))}),r=h.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:i}=mR(s);return h.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:o,onPointerDown:i}}),[t,r,o,i])}function gR(e){const{store:t,parentContext:n,actionsRef:s}=e,r=t.useState("open"),o=t.useState("disablePointerDismissal"),i=t.useState("modal"),a=t.useState("popupElement"),{openMethod:c,triggerProps:l,reset:u}=$f(r);Ri(t);const{forceUnmount:f}=wi(r,t,()=>{u()}),d=X(A=>{const L=ue(A);return L.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},L}),p=h.useCallback(()=>{t.setOpen(!1,d(gi))},[t,d]);h.useImperativeHandle(s,()=>({unmount:f,close:p}),[f,p]);const m=Ei({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,x]=h.useState(0),y=g===0,v=Of(m),R=bi(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(A){if("button"in A&&A.button!==0||"touches"in A&&A.touches.length!==1)return!1;const L=Ue(A);if(y&&!o){const I=L;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===I||t.context.backdropRef.current===I||le(I,a)&&!I?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});Hf(r&&i===!0,a);const{getReferenceProps:w,getFloatingProps:b,getTriggerProps:T}=lr([v,R]);t.useContextCallback("onNestedDialogOpen",A=>{x(A+1)}),t.useContextCallback("onNestedDialogClose",()=>{x(0)}),h.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(g),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,g]);const E=h.useMemo(()=>w(l),[w,l]),S=h.useMemo(()=>T(l),[T,l]),O=h.useMemo(()=>b(),[b]);t.useSyncedValues({openMethod:c,activeTriggerProps:E,inactiveTriggerProps:S,popupProps:O,floatingRootContext:m,nestedOpenDialogCount:g})}const yR={...Ti,modal:q(e=>e.modal),nested:q(e=>e.nested),nestedOpenDialogCount:q(e=>e.nestedOpenDialogCount),disablePointerDismissal:q(e=>e.disablePointerDismissal),openMethod:q(e=>e.openMethod),descriptionElementId:q(e=>e.descriptionElementId),titleElementId:q(e=>e.titleElementId),viewportElement:q(e=>e.viewportElement),role:q(e=>e.role)};class vR extends ir{constructor(t){super(bR(t),{popupRef:h.createRef(),backdropRef:h.createRef(),internalBackdropRef:h.createRef(),triggerElements:new Zn,onOpenChange:void 0,onOpenChangeComplete:void 0},yR)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const r={open:t},o=n.trigger?.id??null;(o||t)&&(r.activeTriggerId=o,r.activeTriggerElement=n.trigger??null),this.update(r)}}function bR(e={}){return{...Si(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function xR(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:r,onOpenChangeComplete:o,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f=null}=e,d=tn(!0),p=!!d,m=it(()=>l?.store??new vR({open:n??s,activeTriggerId:u!==void 0?u:f,modal:a,disablePointerDismissal:i,nested:p})).current;m.useControlledProp("open",n,s),m.useControlledProp("activeTriggerId",u,f),m.useSyncedValues({disablePointerDismissal:i,nested:p,modal:a}),m.useContextCallback("onOpenChange",r),m.useContextCallback("onOpenChangeComplete",o);const g=m.useState("payload");gR({store:m,actionsRef:c,parentContext:d?.store.context});const x=h.useMemo(()=>({store:m}),[m]);return $.jsx(Bf.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}const RR=h.forwardRef(function(t,n){const{render:s,className:r,id:o,...i}=t,{store:a}=tn(),c=Jn(o);return a.useSyncedValueWithCleanup("titleElementId",c),ze("h2",t,{ref:n,props:[{id:c},i]})});function bw({children:e,...t}){return $.jsx(xR,{...t,children:e})}function xw({className:e,children:t}){return $.jsxs(cR,{children:[$.jsx($x,{className:"fixed inset-0 bg-ink/40 transition-all duration-150 data-[state=open]:opacity-100 data-[state=closed]:opacity-0 dark:bg-surface/40"}),$.jsx(aR,{className:Pt("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2","w-[min(400px,92vw)] rounded-[20px] border border-primary-200 bg-primary-50 p-0 shadow-lg","transition-all duration-150","data-[state=open]:opacity-100 data-[state=closed]:opacity-0","data-[state=open]:scale-100 data-[state=closed]:scale-95",e),children:t})]})}function Rw({className:e,...t}){return $.jsx(RR,{className:Pt("text-lg font-medium text-primary-900",e),...t})}function ww({className:e,...t}){return $.jsx(zx,{className:Pt("text-sm text-primary-600",e),...t})}function Sw({className:e,render:t,...n}){return $.jsx(Gx,{render:t||$.jsx(hd,{variant:"outline",className:Pt(e)}),...n})}const Kf=h.createContext(void 0);function _f(e){const t=h.useContext(Kf);if(t===void 0&&!e)throw new Error(Je(33));return t}const Yf=h.createContext(void 0);function nn(e){const t=h.useContext(Yf);if(t===void 0&&!e)throw new Error(Je(36));return t}const wR=h.createContext(void 0);function hr(e=!0){const t=h.useContext(wR);if(t===void 0&&!e)throw new Error(Je(25));return t}const SR={type:"regular-item"};function TR(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:r,store:o,nativeButton:i,itemMetadata:a,nodeId:c}=e,l=h.useRef(null),u=hr(!0),f=u!==void 0,{events:d}=o.useState("floatingTreeRoot"),{getButtonProps:p,buttonRef:m}=Oi({disabled:n,focusableWhenDisabled:!0,native:i}),g=h.useCallback(y=>Ms({id:r,role:"menuitem",tabIndex:s?0:-1,onMouseMove(v){c&&d.emit("itemhover",{nodeId:c,target:v.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(v){v.key===" "&&o.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&d.emit("close",{domEvent:v,reason:sf})},onMouseUp(v){if(u){const R=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,f&&R&&Math.abs(v.clientX-R.x)<=1&&Math.abs(v.clientY-R.y)<=1)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&l.current.click()}},y,p),[r,s,p,t,d,o,f,u,a,c]),x=Cs(l,m);return h.useMemo(()=>({getItemProps:g,itemRef:x}),[g,x])}const Gf=h.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ER(){return h.useContext(Gf)}let CR=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function zf(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:r,index:o}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:f}=ER(),d=h.useRef(-1),[p,m]=h.useState(o??(r===CR.GuessFromOrder?()=>{if(d.current===-1){const y=f.current;f.current+=1,d.current=y}return d.current}:-1)),g=h.useRef(null),x=h.useCallback(y=>{if(g.current=y,p!==-1&&y!==null&&(l.current[p]=y,u)){const v=t!==void 0;u.current[p]=v?t:s?.current?.textContent??y.textContent}},[p,l,u,t,s]);return ee(()=>{if(o!=null)return;const y=g.current;if(y)return i(y,n),()=>{a(y)}},[o,i,a,n]),ee(()=>{if(o==null)return c(y=>{const v=g.current?y.get(g.current)?.index:null;v!=null&&m(v)})},[o,c,m]),h.useMemo(()=>({ref:x,index:p}),[p,x])}const PR=h.forwardRef(function(t,n){const{render:s,className:r,id:o,label:i,nativeButton:a=!1,disabled:c=!1,closeOnClick:l=!0,...u}=t,f=zf({label:i}),d=_f(!0),p=Jn(o),{store:m}=nn(),g=m.useState("isActive",f.index),x=m.useState("itemProps"),{getItemProps:y,itemRef:v}=TR({closeOnClick:l,disabled:c,highlighted:g,id:p,store:m,nativeButton:a,nodeId:d?.nodeId,itemMetadata:SR}),R=h.useMemo(()=>({disabled:c,highlighted:g}),[c,g]);return ze("div",t,{state:R,props:[x,u,y],ref:[v,n,f.ref]})}),MR=h.createContext(void 0);function OR(e){return h.useContext(MR)}const AR={...En,...ar},IR=h.forwardRef(function(t,n){const{render:s,className:r,finalFocus:o,...i}=t,{store:a}=nn(),{side:c,align:l}=_f(),u=OR()!=null,f=a.useState("open"),d=a.useState("transitionStatus"),p=a.useState("popupProps"),m=a.useState("mounted"),g=a.useState("instantType"),x=a.useState("activeTriggerElement"),y=a.useState("parent"),v=a.useState("lastOpenChangeReason"),R=a.useState("rootId"),w=a.useState("floatingRootContext"),b=a.useState("floatingTreeRoot"),T=a.useState("closeDelay"),E=a.useState("activeTriggerElement"),S=y.type==="context-menu";cr({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),h.useEffect(()=>{function N(D){a.setOpen(!1,ue(D.reason,D.domEvent))}return b.events.on("close",N),()=>{b.events.off("close",N)}},[b.events,a]);const O=a.useState("hoverEnabled"),A=a.useState("disabled");Pf(w,{enabled:O&&!A&&!S&&y.type!=="menubar",closeDelay:T});const L=h.useMemo(()=>({transitionStatus:d,side:c,align:l,open:f,nested:y.type==="menu",instant:g}),[d,c,l,f,y.type,g]),I=ze("div",t,{state:L,ref:[n,a.context.popupRef],stateAttributesMapping:AR,props:[p,{onKeyDown(N){u&&Uf.has(N.key)&&N.stopPropagation()}},Pi(d),i,{"data-rootownerid":R}]});let C=y.type===void 0||S;return(x||y.type==="menubar"&&v!==mi)&&(C=!0),$.jsx(hf,{context:w,modal:S,disabled:!m,returnFocus:o===void 0?C:o,initialFocus:y.type!=="menu",restoreFocus:!0,externalTree:y.type!=="menubar"?b:void 0,previousFocusableElement:E,nextFocusableElement:y.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:I})}),Xf=h.createContext(void 0);function DR(){const e=h.useContext(Xf);if(e===void 0)throw new Error(Je(32));return e}const kR=h.forwardRef(function(t,n){const{keepMounted:s=!1,...r}=t,{store:o}=nn();return o.useState("mounted")||s?$.jsx(Xf.Provider,{value:s,children:$.jsx(df,{ref:n,...r})}):null});function LR(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:r}=e,o=X(r),i=h.useRef(0),a=it(FR).current,c=it(VR).current,[l,u]=h.useState(0),f=h.useRef(l),d=X((y,v)=>{c.set(y,v??null),f.current+=1,u(f.current)}),p=X(y=>{c.delete(y),f.current+=1,u(f.current)}),m=h.useMemo(()=>{const y=new Map;return Array.from(c.keys()).filter(R=>R.isConnected).sort(NR).forEach((R,w)=>{const b=c.get(R)??{};y.set(R,{...b,index:w})}),y},[c,l]);ee(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const y=new MutationObserver(v=>{const R=new Set,w=b=>R.has(b)?R.delete(b):R.add(b);v.forEach(b=>{b.removedNodes.forEach(w),b.addedNodes.forEach(w)}),R.size===0&&(f.current+=1,u(f.current))});return m.forEach((v,R)=>{R.parentElement&&y.observe(R.parentElement,{childList:!0})}),()=>{y.disconnect()}},[m]),ee(()=>{f.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),s&&s.current.length!==m.size&&(s.current.length=m.size),i.current=m.size),o(m)},[o,m,n,s,l]),ee(()=>()=>{n.current=[]},[n]),ee(()=>()=>{s&&(s.current=[])},[s]);const g=X(y=>(a.add(y),()=>{a.delete(y)}));ee(()=>{a.forEach(y=>y(m))},[a,m]);const x=h.useMemo(()=>({register:d,unregister:p,subscribeMapChange:g,elementsRef:n,labelsRef:s,nextIndexRef:i}),[d,p,g,n,s,i]);return $.jsx(Gf.Provider,{value:x,children:t})}function VR(){return new Map}function FR(){return new Set}function NR(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const BR=h.forwardRef(function(t,n){const{anchor:s,positionMethod:r="absolute",className:o,render:i,side:a,align:c,sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:x=kd,...y}=t,{store:v}=nn(),R=DR(),w=hr(!0),b=v.useState("parent"),T=v.useState("floatingRootContext"),E=v.useState("floatingTreeRoot"),S=v.useState("mounted"),O=v.useState("open"),A=v.useState("modal"),L=v.useState("activeTriggerElement"),I=v.useState("lastOpenChangeReason"),C=v.useState("floatingNodeId"),N=v.useState("floatingParentNodeId");let D=s,j=l,k=u,P=c,B=x;b.type==="context-menu"&&(D=s??b.context?.anchor,P=P??"start",!a&&P!=="center"&&(k=t.alignOffset??2,j=t.sideOffset??-5));let V=a,Y=P;b.type==="menu"?(V=V??"inline-end",Y=Y??"start",B=t.collisionAvoidance??Kc):b.type==="menubar"&&(V=V??"bottom",Y=Y??"start");const ie=b.type==="context-menu",W=Ff({anchor:D,floatingRootContext:T,positionMethod:w?"fixed":r,mounted:S,side:V,sideOffset:j,align:Y,alignOffset:k,arrowPadding:ie?0:p,collisionBoundary:f,collisionPadding:d,sticky:m,nodeId:C,keepMounted:R,disableAnchorTracking:g,collisionAvoidance:B,shiftCrossAxis:ie,externalTree:E}),ae=h.useMemo(()=>{const oe={};return O||(oe.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...W.positionerStyles,...oe}}},[O,S,W.positionerStyles]);h.useEffect(()=>{function oe(he){he.open?(he.parentNodeId===C&&v.set("hoverEnabled",!1),he.nodeId!==C&&he.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,ue(In))):he.parentNodeId===C&&he.reason!==In&&v.set("hoverEnabled",!0)}return E.events.on("menuopenchange",oe),()=>{E.events.off("menuopenchange",oe)}},[v,E.events,C]),h.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function oe(he){if(he.open||he.nodeId!==v.select("floatingParentNodeId"))return;const M=he.reason??In;v.setOpen(!1,ue(M))}return E.events.on("menuopenchange",oe),()=>{E.events.off("menuopenchange",oe)}},[E.events,v]),h.useEffect(()=>{function oe(he){!O||he.nodeId!==v.select("floatingParentNodeId")||he.target&&L&&L!==he.target&&v.setOpen(!1,ue(In))}return E.events.on("itemhover",oe),()=>{E.events.off("itemhover",oe)}},[E.events,O,L,v]),h.useEffect(()=>{const oe={open:O,nodeId:C,parentNodeId:N,reason:v.select("lastOpenChangeReason")};E.events.emit("menuopenchange",oe)},[E.events,O,v,C,N]);const fe=h.useMemo(()=>({open:O,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:b.type==="menu"}),[O,W.side,W.align,W.anchorHidden,b.type]),re=h.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),J=ze("div",t,{state:fe,stateAttributesMapping:En,ref:[n,v.useStateSetter("positionerElement")],props:[ae,y]}),ge=S&&b.type!=="menu"&&(b.type!=="menubar"&&A&&I!==We||b.type==="menubar"&&b.context.modal);let pe=null;return b.type==="menubar"?pe=b.context.contentElement:b.type===void 0&&(pe=L),$.jsxs(Kf.Provider,{value:re,children:[ge&&$.jsx(Wf,{ref:b.type==="context-menu"||b.type==="nested-context-menu"?b.context.internalBackdropRef:null,inert:Nf(!O),cutout:pe}),$.jsx(xv,{id:C,children:$.jsx(LR,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:J})})]})}),jR=h.createContext(null);function qf(e){return h.useContext(jR)}const UR={...Ti,disabled:q(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:q(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:q(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:q(e=>e.stickIfOpen),parent:q(e=>e.parent),rootId:q(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:q(e=>e.activeIndex),isActive:q((e,t)=>e.activeIndex===t),hoverEnabled:q(e=>e.hoverEnabled),instantType:q(e=>e.instantType),lastOpenChangeReason:q(e=>e.openChangeReason),floatingTreeRoot:q(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:q(e=>e.floatingNodeId),floatingParentNodeId:q(e=>e.floatingParentNodeId),itemProps:q(e=>e.itemProps),closeDelay:q(e=>e.closeDelay),keyboardEventRelay:q(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Li extends ir{constructor(t){super({...WR(),...t},{positionerRef:h.createRef(),popupRef:h.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:h.createRef(),beforeContentFocusGuardRef:h.createRef(),onOpenChangeComplete:void 0,triggerElements:new Zn},UR),this.observe(q(n=>n.allowMouseEnter),(n,s)=>{this.state.parent.type==="menu"&&n!==s&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const s=it(()=>new Li(n)).current;return t??s}unsubscribeParentListener=null}function WR(){return{...Si(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new hi,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:rt,keyboardEventRelay:void 0,closeDelay:0}}const HR=h.createContext(void 0);function $R(){return h.useContext(HR)}function KR(e){const{children:t,open:n,onOpenChange:s,onOpenChangeComplete:r,defaultOpen:o=!1,disabled:i=!1,modal:a,loopFocus:c=!0,orientation:l="vertical",actionsRef:u,closeParentOnEsc:f=!1,handle:d,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:g=!0}=e,x=hr(!0),y=nn(!0),v=qf(),R=$R(),w=h.useMemo(()=>R&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:x&&!y?{type:"context-menu",context:x}:{type:void 0},[x,y,v,R]),b=Li.useStore(d?.store,{parent:w}),T=b.useState("floatingTreeRoot"),E=nf(T),S=Mt();ee(()=>{x&&!y?b.update({parent:{type:"context-menu",context:x},floatingNodeId:E,floatingParentNodeId:S}):y&&b.update({floatingNodeId:E,floatingParentNodeId:S})},[x,y,E,S,b]),b.useControlledProp("open",n,o),b.useControlledProp("activeTriggerId",p,m),b.useContextCallback("onOpenChangeComplete",r);const O=b.useState("open"),A=b.useState("activeTriggerElement"),L=b.useState("positionerElement"),I=b.useState("hoverEnabled"),C=b.useState("modal"),N=b.useState("disabled"),D=b.useState("lastOpenChangeReason"),j=b.useState("parent"),k=b.useState("activeIndex"),P=b.useState("payload"),B=b.useState("floatingParentNodeId"),V=h.useRef(null),Y=B!=null;let ie;b.useSyncedValues({disabled:i,modal:j.type===void 0?a:void 0,rootId:en()});const{openMethod:W,triggerProps:ae,reset:fe}=$f(O);Ri(b);const{forceUnmount:re}=wi(O,b,()=>{b.update({allowMouseEnter:!1,stickIfOpen:!0}),fe()}),J=h.useRef(j.type!=="context-menu"),ge=Ge();h.useEffect(()=>{if(O||(V.current=null),j.type==="context-menu"){if(!O){ge.clear(),J.current=!1;return}ge.start(500,()=>{J.current=!0})}},[ge,O,j.type]),Hf(O&&C&&D!==We&&W!=="touch",L),ee(()=>{!O&&!I&&b.set("hoverEnabled",!0)},[O,I,b]);const pe=h.useRef(!0),oe=Ge(),he=X((ce,be)=>{const ke=be.reason;if(O===ce&&be.trigger===A&&D===ke||(be.preventUnmountOnClose=()=>{b.set("preventUnmountingOnClose",!0)},!ce&&be.trigger==null&&(be.trigger=A??void 0),s?.(ce,be),be.isCanceled))return;const Ce={open:ce,nativeEvent:be.event,reason:be.reason,nested:Y};ie?.emit("openchange",Ce);const Ie=be.event;if(ce===!1&&Ie?.type==="click"&&Ie.pointerType==="touch"&&!pe.current)return;if(!ce&&k!==null){const et=b.context.itemDomElements.current[k];queueMicrotask(()=>{et?.setAttribute("tabindex","-1")})}ce&&ke===fn?(pe.current=!1,oe.start(300,()=>{pe.current=!0})):(pe.current=!0,oe.clear());const qe=(ke===Vt||ke===sf)&&Ie.detail===0&&Ie?.isTrusted,_e=!ce&&(ke===sr||ke==null);function wt(){const et={open:ce,openChangeReason:ke};V.current=be.event??null;const $t=be.trigger?.id??null;($t||ce)&&(et.activeTriggerId=$t,et.activeTriggerElement=be.trigger??null),b.update(et)}ke===We?yt.flushSync(wt):wt(),j.type==="menubar"&&(ke===fn||ke===yn||ke===We||ke===bs||ke===In)?b.set("instantType","group"):qe||_e?b.set("instantType",qe?"click":"dismiss"):b.set("instantType",void 0)}),M=h.useCallback(ce=>{const be=ue(ce);return be.preventUnmountOnClose=()=>{b.set("preventUnmountingOnClose",!0)},be},[b]),te=h.useCallback(()=>{b.setOpen(!1,M(gi))},[b,M]);h.useImperativeHandle(u,()=>({unmount:re,close:te}),[re,te]);let K;j.type==="context-menu"&&(K=j.context),h.useImperativeHandle(K?.positionerRef,()=>L,[L]),h.useImperativeHandle(K?.actionsRef,()=>({setOpen:he}),[he]);const ye=Ei({popupStore:b,onOpenChange:he});ie=ye.context.events,h.useEffect(()=>{const ce=({open:be,eventDetails:ke})=>he(be,ke);return ie.on("setOpen",ce),()=>{ie?.off("setOpen",ce)}},[ie,he]);const F=bi(ye,{enabled:!N,bubbles:{escapeKey:f&&j.type==="menu"},outsidePress(){return j.type!=="context-menu"||V.current?.type==="contextmenu"?!0:J.current},externalTree:Y?T:void 0}),U=Of(ye,{role:"menu"}),z=Lf(),ne=h.useCallback(ce=>{b.select("activeIndex")!==ce&&b.set("activeIndex",ce)},[b]),de=dx(ye,{enabled:!N,listRef:b.context.itemDomElements,activeIndex:k,nested:j.type!==void 0,loopFocus:c,orientation:l,parentOrientation:j.type==="menubar"?j.context.orientation:void 0,rtl:z==="rtl",disabledIndices:Ps,onNavigate:ne,openOnArrowKeyDown:j.type!=="context-menu",externalTree:Y?T:void 0,focusItemOnHover:g}),Q=h.useCallback(ce=>{b.context.typingRef.current=ce},[b]),Z=px(ye,{listRef:b.context.itemLabels,activeIndex:k,resetMs:Od,onMatch:ce=>{O&&ce!==k&&b.set("activeIndex",ce)},onTypingChange:Q}),{getReferenceProps:H,getFloatingProps:se,getItemProps:G,getTriggerProps:me}=lr([F,U,de,Z]),xe=h.useMemo(()=>{const ce=Ms(H(),{onMouseEnter(){b.set("hoverEnabled",!0)},onMouseMove(){b.set("allowMouseEnter",!0)}},ae);return delete ce.role,ce},[H,b,ae]),Te=h.useMemo(()=>{const ce=me();if(!ce)return ce;const be=Ms(ce,ae);return delete be.role,delete be["aria-controls"],be},[me,ae]),we=rr(),Fe=h.useMemo(()=>se({onMouseEnter(){j.type==="menu"&&we.request(()=>b.set("hoverEnabled",!1))},onMouseMove(){b.set("allowMouseEnter",!0)},onClick(){b.select("hoverEnabled")&&b.set("hoverEnabled",!1)},onKeyDown(ce){const be=b.select("keyboardEventRelay");be&&!ce.isPropagationStopped()&&be(ce)}}),[se,j.type,we,b]),Le=h.useMemo(()=>G(),[G]);b.useSyncedValues({floatingRootContext:ye,activeTriggerProps:xe,inactiveTriggerProps:Te,popupProps:Fe,itemProps:Le});const Xe=h.useMemo(()=>({store:b,parent:w}),[b,w]),at=$.jsx(Yf.Provider,{value:Xe,children:typeof t=="function"?t({payload:P}):t});return j.type===void 0||j.type==="context-menu"?$.jsx(Rv,{externalTree:T,children:at}):at}function _R(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const o=parseFloat(n.width)||0,i=parseFloat(n.height)||0,a=parseFloat(s.width)||0,c=parseFloat(s.height)||0,l=Math.max(t.width,o,a),u=Math.max(t.height,i,c),f=l-t.width,d=u-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-d/2,bottom:t.bottom+d/2}}function YR(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Mi(),{ref:r,index:o}=zf(e),i=n===o,a=h.useRef(null),c=Cs(r,a);return{compositeProps:h.useMemo(()=>({tabIndex:i?0:-1,onFocus(){s(o)},onMouseMove(){const u=a.current;if(!t||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!f&&u.focus()}}),[i,s,o,t]),compositeRef:c,index:o}}function GR(e){const{render:t,className:n,state:s=rt,props:r=Ps,refs:o=Ps,metadata:i,stateAttributesMapping:a,tag:c="div",...l}=e,{compositeProps:u,compositeRef:f}=YR({metadata:i});return ze(c,e,{state:s,ref:[...o,f],props:[u,...r,l],stateAttributesMapping:a})}function Qf(e){if(Se(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!mt(e))return Qf(bt(e))}function zR(e){const{enabled:t=!0,mouseDownAction:n,open:s}=e,r=h.useRef(!1);return h.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!s||n==="close"&&s)&&(r.current=!0,xt(o.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:o=>{r.current&&(r.current=!1,o.preventBaseUIHandler())}}:rt,[t,n,s])}const ps=2,XR=h.forwardRef(function(t,n){const{render:s,className:r,disabled:o=!1,nativeButton:i=!0,id:a,openOnHover:c,delay:l=100,closeDelay:u=0,handle:f,payload:d,...p}=t,m=nn(!0),g=f?.store??m?.store;if(!g)throw new Error(Je(85));const x=Jn(a),y=g.useState("isTriggerActive",x),v=g.useState("floatingRootContext"),R=g.useState("isOpenedByTrigger",x),w=h.useRef(null),b=QR(),T=Mi(!0),E=Ht(),S=h.useMemo(()=>E??new hi,[E]),O=nf(S),A=Mt(),{registerTrigger:L,isMountedByThisTrigger:I}=Tf(x,w,g,{payload:d,closeDelay:u,parent:b,floatingTreeRoot:S,floatingNodeId:O,floatingParentNodeId:A,keyboardEventRelay:T?.relayKeyboardEvent}),C=b.type==="menubar",N=g.useState("disabled"),D=o||N||C&&b.context.disabled,{getButtonProps:j,buttonRef:k}=Oi({disabled:D,native:i});h.useEffect(()=>{!R&&b.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,R,b.type]);const P=h.useRef(null),B=Ge(),V=X(U=>{if(!P.current)return;B.clear(),g.context.allowMouseUpTriggerRef.current=!1;const z=U.target;if(le(P.current,z)||le(g.select("positionerElement"),z)||z===P.current||z!=null&&Qf(z)===g.select("rootId"))return;const ne=_R(P.current);U.clientX>=ne.left-ps&&U.clientX<=ne.right+ps&&U.clientY>=ne.top-ps&&U.clientY<=ne.bottom+ps||S.events.emit("close",{domEvent:U,reason:Sv})});h.useEffect(()=>{R&&g.select("lastOpenChangeReason")===We&&xt(P.current).addEventListener("mouseup",V,{once:!0})},[R,V,g]);const Y=C&&b.context.hasSubmenuOpen,W=Mf(v,{enabled:(c??Y)&&!D&&b.type!=="context-menu"&&(!C||Y&&!I),handleClose:Af({blockPointerEvents:!C}),mouseOnly:!0,move:!1,restMs:b.type===void 0?l:void 0,delay:{close:u},triggerElementRef:w,externalTree:S,isActiveTrigger:y}),ae=qR(R,g.select("lastOpenChangeReason")),fe=Fv(v,{enabled:!D&&b.type!=="context-menu",event:R&&C?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0?ae:!1}),re=Ef(v,{enabled:!D&&Y}),J=zR({open:R,enabled:C,mouseDownAction:"open"}),ge=lr([fe,re]),pe=h.useMemo(()=>({disabled:D,open:R}),[D,R]),oe=g.useState("triggerProps",I),he=[P,n,k,L,w],M=[ge.getReferenceProps(),W??rt,oe,{"aria-haspopup":"menu",id:x,onMouseDown:U=>{if(g.select("open"))return;B.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),xt(U.currentTarget).addEventListener("mouseup",V,{once:!0})}},C?{role:"menuitem"}:{},J,p,j],te=h.useRef(null),K=X(U=>{yt.flushSync(()=>{g.setOpen(!1,ue(yn,U.nativeEvent,U.currentTarget))}),gv(te.current)?.focus()}),ye=X(U=>{const z=g.select("positionerElement");if(z&&un(U,z))g.context.beforeContentFocusGuardRef.current?.focus();else{yt.flushSync(()=>{g.setOpen(!1,ue(yn,U.nativeEvent,U.currentTarget))});let ne=mv(g.context.triggerFocusTargetRef.current||w.current);for(;ne!==null&&le(z,ne);){const de=ne;if(ne=di(ne),ne===de)break}ne?.focus()}}),F=ze("button",t,{enabled:!C,stateAttributesMapping:Ic,state:pe,ref:he,props:M});return C?$.jsx(GR,{tag:"button",render:s,className:r,state:pe,refs:he,props:M,stateAttributesMapping:Ic}):R?$.jsxs(h.Fragment,{children:[$.jsx(bn,{ref:te,onFocus:K},`${x}-pre-focus-guard`),$.jsx(h.Fragment,{children:F},x),$.jsx(bn,{ref:g.context.triggerFocusTargetRef,onFocus:ye},`${x}-post-focus-guard`)]}):$.jsx(h.Fragment,{children:F},x)});function qR(e,t){const n=Ge(),[s,r]=h.useState(!1);return ee(()=>{e&&t==="trigger-hover"?(r(!0),n.start(Ad,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),s}function QR(){const e=hr(!0),t=nn(!0),n=qf();return h.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Tw({children:e,...t}){return $.jsx(KR,{...t,children:e})}function Ew({className:e,...t}){return $.jsx(XR,{className:Pt(e),...t})}function Cw({className:e,side:t="bottom",align:n="end",children:s}){return $.jsx(kR,{children:$.jsx(BR,{side:t,align:n,children:$.jsx(IR,{className:Pt("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:s})})})}function Pw({className:e,...t}){return $.jsx(PR,{className:Pt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...t})}export{cw as $,dt as A,cr as B,Ge as C,bw as D,le as E,Lf as F,Iy as G,Ew as H,Cw as I,Pw as J,nw as K,aw as L,Tw as M,iw as N,lw as O,uw as P,fw as Q,dw as R,tw as S,_n as T,rw as U,_c as V,sw as W,Ze as X,Se as Y,Bs as Z,ve as _,xw as a,af as a0,LR as a1,YR as a2,ht as a3,xt as a4,vw as a5,mw as a6,eR as a7,yw as a8,Lr as a9,lc as aa,Qy as ab,Bn as ac,qy as ad,Zy as ae,Ii as af,ki as ag,Jy as ah,fr as ai,dr as aj,Di as ak,Ai as al,Ne as am,Nn as an,pw as ao,Jx as ap,hw as aq,Zx as ar,gw as as,Kx as at,Rw as b,ww as c,Sw as d,vR as e,gR as f,Bf as g,cR as h,$x as i,aR as j,RR as k,zx as l,Gx as m,qb as n,Jn as o,Jb as p,X as q,ue as r,ee as s,Vt as t,tn as u,ar as v,Oi as w,rr as x,Ou as y,pi as z};
|