@antseed/gateway-console 0.1.1 → 0.1.2

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.
Files changed (137) hide show
  1. package/dist/assets/{Activity-aMw4GLn_.js → Activity-BHckTctH.js} +1 -1
  2. package/dist/assets/{Audit-CCre2vZ2.js → Audit-CheQE0ki.js} +1 -1
  3. package/dist/assets/{ChainGate-rOjMTVIg.js → ChainGate-BO2NzC31.js} +1 -1
  4. package/dist/assets/{ChannelClose-DkQxS0-Z.js → ChannelClose-ODGHySRH.js} +1 -1
  5. package/dist/assets/{Charts-NmIMcccv.js → Charts-CrCKBk_i.js} +1 -1
  6. package/dist/assets/{ConnectWallet-QN7kfDQq.js → ConnectWallet-BqD3R1R9.js} +1 -1
  7. package/dist/assets/{DataTable-D2QIQ-gI.js → DataTable-B36eMErM.js} +1 -1
  8. package/dist/assets/{Disclosure-h1MJg5Wn.js → Disclosure-DS6GTz8G.js} +1 -1
  9. package/dist/assets/{KeyHolder-DUhCBfBH.js → KeyHolder-CG5sSLQK.js} +1 -1
  10. package/dist/assets/{Keys-DIlH-qns.js → Keys-Cxz0K09V.js} +1 -1
  11. package/dist/assets/{Logs-BPrDGUHL.js → Logs-DV-trPqy.js} +1 -1
  12. package/dist/assets/{Members-Cud9TWBJ.js → Members-Cp_3A-Dy.js} +1 -1
  13. package/dist/assets/{Migrate-DEIQ12oJ.js → Migrate-BD-0-NY-.js} +1 -1
  14. package/dist/assets/{Models-DXI7RYae.js → Models-DHeLeAiN.js} +1 -1
  15. package/dist/assets/{OperatorActions-BC74iRfA.js → OperatorActions-Bety6436.js} +1 -1
  16. package/dist/assets/{OperatorGateAlert-CIQwPW1h.js → OperatorGateAlert-Jd5E0V_d.js} +1 -1
  17. package/dist/assets/{Overview-ipvNEEut.js → Overview-37mja3y-.js} +1 -1
  18. package/dist/assets/{PolicyEditor-CRhTwGq0.js → PolicyEditor-B5BAs2vC.js} +1 -1
  19. package/dist/assets/{PolicyField-0xAOIP4-.js → PolicyField-D7O5D7fl.js} +1 -1
  20. package/dist/assets/{Presets-DrJ48O3s.js → Presets-CgfFG3fw.js} +1 -1
  21. package/dist/assets/{Providers-CcIj0C5E.js → Providers-sZFgSVHV.js} +1 -1
  22. package/dist/assets/{RequestLog-CBZWWnHo.js → RequestLog-BbR8E_9_.js} +1 -1
  23. package/dist/assets/{Rewards-CUru480X.js → Rewards-CuWsg5m7.js} +2 -2
  24. package/dist/assets/{RewardsClaim-BjwCidx5.js → RewardsClaim-CRgTiF93.js} +1 -1
  25. package/dist/assets/{Routing-BO7JFJGH.js → Routing-BebcQMko.js} +1 -1
  26. package/dist/assets/{Segmented-BJmgB5-Y.js → Segmented-C9jux-Mr.js} +1 -1
  27. package/dist/assets/{SelectField-D_BPTzpT.js → SelectField-BSNXjRiC.js} +1 -1
  28. package/dist/assets/{Settings-qFQk36WV.js → Settings-BLIkiFNw.js} +1 -1
  29. package/dist/assets/{Switch-JCyfy3G5.js → Switch-hSHNLapF.js} +1 -1
  30. package/dist/assets/{Tabs-CGI9v1OW.js → Tabs-Dle_Eq4t.js} +1 -1
  31. package/dist/assets/{TextAreaField-4JuDDT4k.js → TextAreaField-9B3_7w3L.js} +1 -1
  32. package/dist/assets/{UsageByModel-jvNkVE4M.js → UsageByModel-6qZIqVRY.js} +1 -1
  33. package/dist/assets/{Wallet-tlCKFe2Q.js → Wallet-BbwYd9fm.js} +3 -3
  34. package/dist/assets/{WalletConfirm-Dz6gVYW9.js → WalletConfirm-Dm8Lr6DT.js} +1 -1
  35. package/dist/assets/{WalletFunding-NSKzSiY5.js → WalletFunding-CSVVBvPP.js} +1 -1
  36. package/dist/assets/{WalletSignIn-Bs_yxjak.js → WalletSignIn-DLX6sQbD.js} +1 -1
  37. package/dist/assets/{Workspaces-C79eSjJK.js → Workspaces-DZmGjFFI.js} +1 -1
  38. package/dist/assets/{add-CxYxphqt.js → add-DXI2Cp6k.js} +1 -1
  39. package/dist/assets/{all-wallets-BSHfFrwc.js → all-wallets-LQt3S9MV.js} +1 -1
  40. package/dist/assets/{app-store-DzDsfjeG.js → app-store-CRiNXiqm.js} +1 -1
  41. package/dist/assets/{apple-N_ET94Rt.js → apple-BXH3yGFL.js} +1 -1
  42. package/dist/assets/{arrow-bottom-U6RBQjWC.js → arrow-bottom-D3S4BxFo.js} +1 -1
  43. package/dist/assets/{arrow-bottom-circle-tDeqZ1Ky.js → arrow-bottom-circle-Zukia-8I.js} +1 -1
  44. package/dist/assets/{arrow-left-BShNPqIx.js → arrow-left-DHP2QErV.js} +1 -1
  45. package/dist/assets/{arrow-right-CNSfQOzD.js → arrow-right-Co_bi7Vn.js} +1 -1
  46. package/dist/assets/{arrow-top-DV_peLyo.js → arrow-top-D3hEtyvW.js} +1 -1
  47. package/dist/assets/{bank-CBIxfTrG.js → bank-CZ3b6K7o.js} +1 -1
  48. package/dist/assets/{basic-N6vekuGx.js → basic-nJtiapU4.js} +1 -1
  49. package/dist/assets/{browser-CSb6b6iQ.js → browser-CRgINMXV.js} +1 -1
  50. package/dist/assets/{card-DrFIu-YX.js → card-ZwByuY3V.js} +1 -1
  51. package/dist/assets/{ccip-kqAjTfpP.js → ccip-DpVxliwq.js} +1 -1
  52. package/dist/assets/{checkmark-CjzmzCYU.js → checkmark-BS_v4cXd.js} +1 -1
  53. package/dist/assets/{checkmark-bold-B66sPzPs.js → checkmark-bold-gJWlj_By.js} +1 -1
  54. package/dist/assets/{chevron-bottom--JM7vIl_.js → chevron-bottom-DB25HS1C.js} +1 -1
  55. package/dist/assets/{chevron-left-CPo0GZiC.js → chevron-left-nQo8fTuX.js} +1 -1
  56. package/dist/assets/{chevron-right-BgXTpiHp.js → chevron-right-D18s-hRU.js} +1 -1
  57. package/dist/assets/{chevron-top-BDxNAlrf.js → chevron-top-Dj1C_edY.js} +1 -1
  58. package/dist/assets/{chrome-store-BCPQdBXr.js → chrome-store-BM7Ft7N1.js} +1 -1
  59. package/dist/assets/{clock-B7Udw_0s.js → clock-Gp9Oq3uQ.js} +1 -1
  60. package/dist/assets/{close-ClhMnzas.js → close-CvZGqQc2.js} +1 -1
  61. package/dist/assets/{coinPlaceholder-Bsvaf8UD.js → coinPlaceholder-CxGDG0FR.js} +1 -1
  62. package/dist/assets/{compass-CtgRkLwG.js → compass-D_QgO5G3.js} +1 -1
  63. package/dist/assets/{copy-Cju_aL0g.js → copy-ClteGnkV.js} +1 -1
  64. package/dist/assets/{core-Dv4ivRNs.js → core-BGzEHhOa.js} +3 -3
  65. package/dist/assets/cursor-CrB_GPgJ.js +3 -0
  66. package/dist/assets/{cursor-transparent-A0O6SzCH.js → cursor-transparent-D2iBVjlE.js} +1 -1
  67. package/dist/assets/{desktop-CuYleYi9.js → desktop-C7ehLazj.js} +1 -1
  68. package/dist/assets/{disconnect-UdfoNj_d.js → disconnect-DfCN-2S3.js} +1 -1
  69. package/dist/assets/{discord-CBP0IyFM.js → discord-wpQmn3Vb.js} +1 -1
  70. package/dist/assets/{en_US-Y4ZOVFV4-3vDquI1C.js → en_US-Y4ZOVFV4-BuTiJwkw.js} +4 -4
  71. package/dist/assets/{etherscan-PHAlrHol.js → etherscan-2pj2VsLB.js} +1 -1
  72. package/dist/assets/{exclamation-triangle-udtYedHZ.js → exclamation-triangle-D3kTTS0o.js} +1 -1
  73. package/dist/assets/{extension-BSfnWZTn.js → extension-BaGxTMr_.js} +1 -1
  74. package/dist/assets/{external-link-BhINeBf6.js → external-link-DPkcev-7.js} +1 -1
  75. package/dist/assets/{facebook-DPMSywQV.js → facebook-B-3uuPNQ.js} +1 -1
  76. package/dist/assets/{farcaster-BgZocY3-.js → farcaster-CP4KBXgf.js} +1 -1
  77. package/dist/assets/{filters-H_ETj-7w.js → filters-DayLkPQN.js} +1 -1
  78. package/dist/assets/{github-Dnt_pb3p.js → github-nb58vW5j.js} +1 -1
  79. package/dist/assets/{google-Mu_8pwD-.js → google-Cbr4pP2d.js} +1 -1
  80. package/dist/assets/{help-circle-DRVJ-8K8.js → help-circle-dO8TgJbO.js} +1 -1
  81. package/dist/assets/{highlighted-body-KQOG7T2V-ClwcaYX1.js → highlighted-body-KQOG7T2V-D_9pxxPW.js} +1 -1
  82. package/dist/assets/{id-DXjcfKMm.js → id-FL_XAzzL.js} +1 -1
  83. package/dist/assets/{image-Bhqm-9NV.js → image-D0cgJ5JG.js} +1 -1
  84. package/dist/assets/{index-C21bvTBH.js → index-BjRmy3XE.js} +3 -3
  85. package/dist/assets/{index-BrcuwiCz.js → index-Bv4ef0pT.js} +1 -1
  86. package/dist/assets/{index-C9wUwD4n.js → index-CWuVUb-3.js} +3 -3
  87. package/dist/assets/{index-U4U6E7fq.css → index-CqEPMnZS.css} +1 -1
  88. package/dist/assets/{index-DNA9wtqn.js → index-DvqgpSC-.js} +1 -1
  89. package/dist/assets/{index-CR02SnS1.js → index-Vg8tZZdB.js} +1 -1
  90. package/dist/assets/index-iM-80gy8.js +1 -0
  91. package/dist/assets/{index.es-DX2eegnP.js → index.es-D7XOFxw2.js} +4 -4
  92. package/dist/assets/{info-BaRtFUwf.js → info-DtK2iYRv.js} +1 -1
  93. package/dist/assets/{info-circle-Bsl8G0Ii.js → info-circle-D7UwRt4U.js} +1 -1
  94. package/dist/assets/{lightbulb-BlV4kI0m.js → lightbulb-ClVdo2zx.js} +1 -1
  95. package/dist/assets/{limits-D_C7APR_.js → limits-BjBtkRFh.js} +1 -1
  96. package/dist/assets/{mail-BPcY_N8f.js → mail-D7xIfGjE.js} +1 -1
  97. package/dist/assets/{mermaid-MCJ5UELQ-DAirhLo4.js → mermaid-MCJ5UELQ-DTUKqcxP.js} +8 -8
  98. package/dist/assets/{metamask-sdk-B0WxSi8v.js → metamask-sdk-BFHzYYth.js} +1 -1
  99. package/dist/assets/{mobile-9_L4G6Kz.js → mobile-oyVoYDtW.js} +1 -1
  100. package/dist/assets/{models-BpLCh6Fr.js → models-D5AfPpBK.js} +1 -1
  101. package/dist/assets/{more-BMrrxkhZ.js → more-DWZmSEse.js} +1 -1
  102. package/dist/assets/{network-placeholder-CYXkxcyL.js → network-placeholder-DkrrPbIk.js} +1 -1
  103. package/dist/assets/{nftPlaceholder-CfIu_Ovu.js → nftPlaceholder-y-NnnMjT.js} +1 -1
  104. package/dist/assets/{off-BpqSEfQB.js → off-Bq6ESslh.js} +1 -1
  105. package/dist/assets/{play-store-BKqBXU1V.js → play-store-BVSRtmaK.js} +1 -1
  106. package/dist/assets/{plus-CSgT3KZh.js → plus-CiV0r3Hz.js} +1 -1
  107. package/dist/assets/{qr-code-edbLJ8Gf.js → qr-code-CQuLdjAg.js} +1 -1
  108. package/dist/assets/{recycle-horizontal-CuX0JB4-.js → recycle-horizontal-Dz6rR748.js} +1 -1
  109. package/dist/assets/{refresh-Dq45LHYF.js → refresh-DNo0Vden.js} +1 -1
  110. package/dist/assets/{reown-logo-CRobwYXY.js → reown-logo-sOWGngZq.js} +1 -1
  111. package/dist/assets/{search-gYoog0zk.js → search-rho6BP4J.js} +1 -1
  112. package/dist/assets/{secp256k1-uRM0t8uf.js → secp256k1-eMq7yeYD.js} +1 -1
  113. package/dist/assets/{send-Pm4IO0Hs.js → send-DxwNodDV.js} +1 -1
  114. package/dist/assets/{swapHorizontal-DhCZ210V.js → swapHorizontal-CJ1qgU06.js} +1 -1
  115. package/dist/assets/{swapHorizontalBold-DHO5cxVU.js → swapHorizontalBold-G3QDMS0U.js} +1 -1
  116. package/dist/assets/{swapHorizontalMedium-VGtbzLgi.js → swapHorizontalMedium-CRUvBpIN.js} +1 -1
  117. package/dist/assets/{swapHorizontalRoundedBold-6HTAC2Np.js → swapHorizontalRoundedBold-DOVIZTm_.js} +1 -1
  118. package/dist/assets/{swapVertical-Dg6bMEa-.js → swapVertical-KviDiZLh.js} +1 -1
  119. package/dist/assets/{telegram-CHXgC-Jw.js → telegram-96Q1zZ7u.js} +1 -1
  120. package/dist/assets/{three-dots-MixBEg-b.js → three-dots-CLIQcjDl.js} +1 -1
  121. package/dist/assets/{twitch-CWrx7ZD7.js → twitch-8bwY5wnt.js} +1 -1
  122. package/dist/assets/{twitterIcon-Vrp2iWQv.js → twitterIcon-yigFfTCz.js} +1 -1
  123. package/dist/assets/{usage-MPZYg7D2.js → usage-4421Rf6_.js} +1 -1
  124. package/dist/assets/{useInfiniteQuery-Bpu8bc5A.js → useInfiniteQuery-DXLHm6RI.js} +1 -1
  125. package/dist/assets/{useTx-Cp52G7Yo.js → useTx-JDF5s1ox.js} +1 -1
  126. package/dist/assets/{verify-Cv1Ie02p.js → verify-BvV_kZ_V.js} +1 -1
  127. package/dist/assets/{verify-filled-D4Of1TFY.js → verify-filled-D31I1gjO.js} +1 -1
  128. package/dist/assets/{w3m-modal-B8kvY5hN.js → w3m-modal-BSlq8p9f.js} +1 -1
  129. package/dist/assets/{wallet-uxpqh3A6.js → wallet-CBsAqlQ7.js} +1 -1
  130. package/dist/assets/{wallet-placeholder-C-l2svWA.js → wallet-placeholder-DHTeowzX.js} +1 -1
  131. package/dist/assets/{walletconnect-0CplSxZT.js → walletconnect-CR_egxhB.js} +1 -1
  132. package/dist/assets/{warning-circle-gLBXgr6A.js → warning-circle-BP-YPvjB.js} +1 -1
  133. package/dist/assets/{x-C17dW4I6.js → x-CpVuDSxb.js} +1 -1
  134. package/dist/index.html +3 -3
  135. package/package.json +3 -3
  136. package/dist/assets/cursor-D3NwpSI9.js +0 -3
  137. package/dist/assets/index-DqHGr8d4.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-D_SYSyRt.js","assets/html-BlS82ilI.js","assets/javascript-wDzz0qaB.js","assets/css-Z72CF80r.js","assets/angular-ts-DGq0tZX5.js","assets/scss-Cw6XMfVs.js","assets/apl-ChzvTHjC.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-DTjqU0_L.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-k33SngOZ.js","assets/html-derivative-DZhk3IEZ.js","assets/sql-DkvoVjww.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-BBKr1ja6.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-LUwhHfY5.js","assets/shellscript-Yzrsuije.js","assets/edge-CJaD-t2L.js","assets/elixir-DkJLSxtU.js","assets/elm-DbKCFpqz.js","assets/erb-CSMaCouu.js","assets/ruby-C8rp0wew.js","assets/haml-GN_XdMnF.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Drrc9bTt.js","assets/glimmer-ts-zeybXsvi.js","assets/hack-Ck6-gGSS.js","assets/handlebars-DPT5vKgj.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-DFQZVq3b.js","assets/jison-wvAkD_A8.js","assets/julia-Cu79e8SL.js","assets/r-Cf5RLm7j.js","assets/just-CMxyWJJc.js","assets/perl-5klg-GXX.js","assets/latex-DJVikpzR.js","assets/tex-D96PA37w.js","assets/liquid-B-duXHXw.js","assets/marko-BYgDmDgU.js","assets/less-B1dDrJ26.js","assets/mdc-DF4WjDMn.js","assets/nextflow-BCxp2Aob.js","assets/nextflow-groovy-CedDknKX.js","assets/nginx-BpAMiNFr.js","assets/nim-nV83PyhX.js","assets/org-6a7ccXN_.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-DoruYMF0.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-DPvrY3IQ.js","assets/scala-CqE71os6.js","assets/csharp-B_TYUkTI.js","assets/dart-CtKP3W-j.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-BtYPkAgq.js","assets/qml-3beO22l8.js","assets/razor-CyjPwjZj.js","assets/rst-CVOjT0e7.js","assets/cmake-D1j8_8rp.js","assets/sas-BGn39htG.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-zscZBeg6.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DACIj5bg.js","assets/surrealql-Cjom0U5J.js","assets/svelte-D84K1R2Q.js","assets/templ-Vpw5XpSW.js","assets/ts-tags-Ls60c9xG.js","assets/twig-D9-LOF2p.js","assets/typst-DamkJZ1Q.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-Dd0kTxKP.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-DSqPwMUe.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-C0RcJ6UU.js","assets/stylus-BEDo0Tqx.js","assets/highlighted-body-KQOG7T2V-ClwcaYX1.js","assets/index-C21bvTBH.js","assets/index-U4U6E7fq.css","assets/clsx-B-dksMZM.js","assets/index-DqHGr8d4.js"])))=>i.map(i=>d[i]);
2
- var j9=Object.defineProperty;var U9=Object.getPrototypeOf;var H9=Reflect.get;var gg=e=>{throw TypeError(e)};var V9=(e,t,r)=>t in e?j9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var G=(e,t,r)=>V9(e,typeof t!="symbol"?t+"":t,r),X0=(e,t,r)=>t.has(e)||gg("Cannot "+r);var je=(e,t,r)=>(X0(e,t,"read from private field"),r?r.call(e):t.get(e)),Ut=(e,t,r)=>t.has(e)?gg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),rt=(e,t,r,n)=>(X0(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Zl=(e,t,r)=>(X0(e,t,"access private method"),r);var bg=(e,t,r)=>H9(U9(e),r,t);import{c3 as Gm,r as k,cg as Ms,j as v,ch as q9,ci as G9,_ as O,t as W9,u as Z9,d as co,q as tn,D as Y9,i as K9,bS as X9,cj as Q9,ck as J9,s as eS,m as yg,U as tS,v as Aa,bQ as Wm,bR as Zm,e as Ws,a8 as rS,f as Lh,h as vg}from"./index-C21bvTBH.js";import{c as Qc}from"./clsx-B-dksMZM.js";import{r as $a}from"./index-DqHGr8d4.js";function X(e,t,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,l);const u=a.prototype,c=Object.keys(u);for(let d=0;d<c.length;d++){const h=c[d];h in o||(o[h]=u[h].bind(o))}}const i=(r==null?void 0:r.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function a(o){var l;const u=r!=null&&r.Parent?new s:this;n(u,o),(l=u._zod).deferred??(l.deferred=[]);for(const c of u._zod.deferred)c();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class ba extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class B6 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const F6={};function Li(e){return F6}function z6(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Dh(e,t){return typeof t=="bigint"?t.toString():t}function Jc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ym(e){return e==null}function Km(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nS(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}const s=r>i?r:i,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}const xg=Symbol("evaluating");function Ye(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==xg)return n===void 0&&(n=xg,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Bs(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qi(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Eg(e){return JSON.stringify(e)}function iS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const sS=Jc(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ca(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Xo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function j6(e){return Ca(e)?{...e}:Array.isArray(e)?[...e]:e}const aS=new Set(["string","number","symbol"]);function Ia(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function _e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function oS(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const lS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function uS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=qi(e._zod.def,{get shape(){const a={};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(a[o]=r.shape[o])}return Bs(this,"shape",a),a},checks:[]});return Gi(e,s)}function cS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete a[o]}return Bs(this,"shape",a),a},checks:[]});return Gi(e,s)}function dS(e,t){if(!Ca(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=qi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Bs(this,"shape",s),s}});return Gi(e,i)}function hS(e,t){if(!Ca(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=qi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Bs(this,"shape",n),n}});return Gi(e,r)}function fS(e,t){const r=qi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Bs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gi(e,r)}function mS(e,t,r){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=qi(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=e?new e({type:"optional",innerType:o[u]}):o[u];return Bs(this,"shape",l),l},checks:[]});return Gi(t,a)}function pS(e,t,r){const n=qi(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new e({type:"nonoptional",innerType:i[a]});return Bs(this,"shape",s),s}});return Gi(t,n)}function da(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function ha(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Yl(e){return typeof e=="string"?e:e==null?void 0:e.message}function Di(e,t,r){var i,s,a,o,l,u;const n={...e,path:e.path??[]};if(!e.message){const c=Yl((a=(s=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,e))??Yl((o=t==null?void 0:t.error)==null?void 0:o.call(t,e))??Yl((l=r.customError)==null?void 0:l.call(r,e))??Yl((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";n.message=c}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Xm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Qo(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const U6=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Dh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},H6=X("$ZodError",U6),V6=X("$ZodError",U6,{Parent:Error});function gS(e,t=r=>r.message){const r={},n=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function bS(e,t=r=>r.message){const r={_errors:[]},n=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let a=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(s))):a[l]=a[l]||{_errors:[]},a=a[l],o++}}};return n(e),r}const Qm=e=>(t,r,n,i)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ba;if(a.issues.length){const o=new((i==null?void 0:i.Err)??e)(a.issues.map(l=>Di(l,s,Li())));throw $6(o,i==null?void 0:i.callee),o}return a.value},Jm=e=>async(t,r,n,i)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((i==null?void 0:i.Err)??e)(a.issues.map(l=>Di(l,s,Li())));throw $6(o,i==null?void 0:i.callee),o}return a.value},e0=e=>(t,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ba;return s.issues.length?{success:!1,error:new(e??H6)(s.issues.map(a=>Di(a,i,Li())))}:{success:!0,data:s.value}},yS=e0(V6),t0=e=>async(t,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Di(a,i,Li())))}:{success:!0,data:s.value}},vS=t0(V6),xS=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qm(e)(t,r,i)},ES=e=>(t,r,n)=>Qm(e)(t,r,n),_S=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Jm(e)(t,r,i)},TS=e=>async(t,r,n)=>Jm(e)(t,r,n),wS=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return e0(e)(t,r,i)},kS=e=>(t,r,n)=>e0(e)(t,r,n),SS=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return t0(e)(t,r,i)},AS=e=>async(t,r,n)=>t0(e)(t,r,n),CS=/^[cC][^\s-]{8,}$/,IS=/^[0-9a-z]+$/,NS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RS=/^[0-9a-vA-V]{20}$/,PS=/^[A-Za-z0-9]{27}$/,OS=/^[a-zA-Z0-9_-]{21}$/,LS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,DS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_g=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,MS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function FS(){return new RegExp(BS,"u")}const zS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$S=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,US=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q6=/^[A-Za-z0-9_-]*$/,VS=/^\+[1-9]\d{6,14}$/,G6="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",qS=new RegExp(`^${G6}$`);function W6(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function GS(e){return new RegExp(`^${W6(e)}$`)}function WS(e){const t=W6({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${G6}T(?:${n})$`)}const ZS=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},YS=/^-?\d+$/,Z6=/^-?\d+(?:\.\d+)?$/,KS=/^(?:true|false)$/i,XS=/^null$/i,QS=/^[^A-Z]*$/,JS=/^[^a-z]*$/,xr=X("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Y6={number:"number",bigint:"bigint",object:"date"},K6=X("$ZodCheckLessThan",(e,t)=>{xr.init(e,t);const r=Y6[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),X6=X("$ZodCheckGreaterThan",(e,t)=>{xr.init(e,t);const r=Y6[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eA=X("$ZodCheckMultipleOf",(e,t)=>{xr.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):nS(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),tA=X("$ZodCheckNumberFormat",(e,t)=>{var a;xr.init(e,t),t.format=t.format||"float64";const r=(a=t.format)==null?void 0:a.includes("int"),n=r?"int":"number",[i,s]=lS[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=i,l.maximum=s,r&&(l.pattern=YS)}),e._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>s&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),rA=X("$ZodCheckMaxLength",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const a=Xm(i);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nA=X("$ZodCheckMinLength",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const a=Xm(i);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),iA=X("$ZodCheckLengthEquals",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{const i=n.value,s=i.length;if(s===t.length)return;const a=Xm(i),o=s>t.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),r0=X("$ZodCheckStringFormat",(e,t)=>{var r,n;xr.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),sA=X("$ZodCheckRegex",(e,t)=>{r0.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),aA=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=QS),r0.init(e,t)}),oA=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=JS),r0.init(e,t)}),lA=X("$ZodCheckIncludes",(e,t)=>{xr.init(e,t);const r=Ia(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),uA=X("$ZodCheckStartsWith",(e,t)=>{xr.init(e,t);const r=new RegExp(`^${Ia(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),cA=X("$ZodCheckEndsWith",(e,t)=>{xr.init(e,t);const r=new RegExp(`.*${Ia(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),dA=X("$ZodCheckOverwrite",(e,t)=>{xr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class hA{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-D_SYSyRt.js","assets/html-BlS82ilI.js","assets/javascript-wDzz0qaB.js","assets/css-Z72CF80r.js","assets/angular-ts-DGq0tZX5.js","assets/scss-Cw6XMfVs.js","assets/apl-ChzvTHjC.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-DTjqU0_L.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-k33SngOZ.js","assets/html-derivative-DZhk3IEZ.js","assets/sql-DkvoVjww.js","assets/bsl-DlhNcFeZ.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/chapel-DTp_pixX.js","assets/c-BIGW1oBm.js","assets/cobol-BBKr1ja6.js","assets/coffee-Ch7k5sss.js","assets/cpp-BMRokrvK.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/crystal-LUwhHfY5.js","assets/shellscript-Yzrsuije.js","assets/edge-CJaD-t2L.js","assets/elixir-DkJLSxtU.js","assets/elm-DbKCFpqz.js","assets/erb-CSMaCouu.js","assets/ruby-C8rp0wew.js","assets/haml-GN_XdMnF.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-TyuKm33G.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DqcFQ5yU.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Drrc9bTt.js","assets/glimmer-ts-zeybXsvi.js","assets/hack-Ck6-gGSS.js","assets/handlebars-DPT5vKgj.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-2-FPmUDs.js","assets/haxe-CfZj7gIn.js","assets/jinja-DFQZVq3b.js","assets/jison-wvAkD_A8.js","assets/julia-Cu79e8SL.js","assets/r-Cf5RLm7j.js","assets/just-CMxyWJJc.js","assets/perl-5klg-GXX.js","assets/latex-DJVikpzR.js","assets/tex-D96PA37w.js","assets/liquid-B-duXHXw.js","assets/marko-BYgDmDgU.js","assets/less-B1dDrJ26.js","assets/mdc-DF4WjDMn.js","assets/nextflow-BCxp2Aob.js","assets/nextflow-groovy-CedDknKX.js","assets/nginx-BpAMiNFr.js","assets/nim-nV83PyhX.js","assets/org-6a7ccXN_.js","assets/ini-BEwlwnbL.js","assets/make-CHLpvVh8.js","assets/php-DoruYMF0.js","assets/vb-Cu-pLBUe.js","assets/clojure-P80f7IUj.js","assets/objective-c-DXmwc3jG.js","assets/docker-BcOcwvcX.js","assets/go-C27-OAKa.js","assets/groovy-gcz8RCvz.js","assets/raku-DXvB9xmW.js","assets/rust-DPvrY3IQ.js","assets/scala-CqE71os6.js","assets/csharp-B_TYUkTI.js","assets/dart-CtKP3W-j.js","assets/ocaml-C0hk2d4L.js","assets/zig-VOosw3JB.js","assets/xsl-CtQFsRM5.js","assets/pug-BtYPkAgq.js","assets/qml-3beO22l8.js","assets/razor-CyjPwjZj.js","assets/rst-CVOjT0e7.js","assets/cmake-D1j8_8rp.js","assets/sas-BGn39htG.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-zscZBeg6.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DACIj5bg.js","assets/surrealql-Cjom0U5J.js","assets/svelte-D84K1R2Q.js","assets/templ-Vpw5XpSW.js","assets/ts-tags-Ls60c9xG.js","assets/twig-D9-LOF2p.js","assets/typst-DamkJZ1Q.js","assets/bat-CickPsom.js","assets/bibtex-CHM0blh-.js","assets/jsonc-Des-eS-w.js","assets/log-2UxHyX5q.js","assets/powershell-Dd0kTxKP.js","assets/swift-C2oV4EkX.js","assets/verilog-nZwndyjY.js","assets/system-verilog-0hqHdDBg.js","assets/vue-DSqPwMUe.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-C0RcJ6UU.js","assets/stylus-BEDo0Tqx.js","assets/highlighted-body-KQOG7T2V-D_9pxxPW.js","assets/index-BjRmy3XE.js","assets/index-CqEPMnZS.css","assets/clsx-B-dksMZM.js","assets/index-iM-80gy8.js"])))=>i.map(i=>d[i]);
2
+ var j9=Object.defineProperty;var U9=Object.getPrototypeOf;var H9=Reflect.get;var gg=e=>{throw TypeError(e)};var V9=(e,t,r)=>t in e?j9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var G=(e,t,r)=>V9(e,typeof t!="symbol"?t+"":t,r),X0=(e,t,r)=>t.has(e)||gg("Cannot "+r);var je=(e,t,r)=>(X0(e,t,"read from private field"),r?r.call(e):t.get(e)),Ut=(e,t,r)=>t.has(e)?gg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),rt=(e,t,r,n)=>(X0(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Zl=(e,t,r)=>(X0(e,t,"access private method"),r);var bg=(e,t,r)=>H9(U9(e),r,t);import{c3 as Gm,r as k,cg as Ms,j as v,ch as q9,ci as G9,_ as O,t as W9,u as Z9,d as co,q as tn,D as Y9,i as K9,bS as X9,cj as Q9,ck as J9,s as eS,m as yg,U as tS,v as Aa,bQ as Wm,bR as Zm,e as Ws,a8 as rS,f as Lh,h as vg}from"./index-BjRmy3XE.js";import{c as Qc}from"./clsx-B-dksMZM.js";import{r as $a}from"./index-iM-80gy8.js";function X(e,t,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,l);const u=a.prototype,c=Object.keys(u);for(let d=0;d<c.length;d++){const h=c[d];h in o||(o[h]=u[h].bind(o))}}const i=(r==null?void 0:r.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function a(o){var l;const u=r!=null&&r.Parent?new s:this;n(u,o),(l=u._zod).deferred??(l.deferred=[]);for(const c of u._zod.deferred)c();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class ba extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class B6 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const F6={};function Li(e){return F6}function z6(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Dh(e,t){return typeof t=="bigint"?t.toString():t}function Jc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ym(e){return e==null}function Km(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nS(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}const s=r>i?r:i,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}const xg=Symbol("evaluating");function Ye(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==xg)return n===void 0&&(n=xg,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Bs(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qi(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Eg(e){return JSON.stringify(e)}function iS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const sS=Jc(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ca(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Xo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function j6(e){return Ca(e)?{...e}:Array.isArray(e)?[...e]:e}const aS=new Set(["string","number","symbol"]);function Ia(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function _e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function oS(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const lS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function uS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=qi(e._zod.def,{get shape(){const a={};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(a[o]=r.shape[o])}return Bs(this,"shape",a),a},checks:[]});return Gi(e,s)}function cS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete a[o]}return Bs(this,"shape",a),a},checks:[]});return Gi(e,s)}function dS(e,t){if(!Ca(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=qi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Bs(this,"shape",s),s}});return Gi(e,i)}function hS(e,t){if(!Ca(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=qi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Bs(this,"shape",n),n}});return Gi(e,r)}function fS(e,t){const r=qi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Bs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gi(e,r)}function mS(e,t,r){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=qi(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=e?new e({type:"optional",innerType:o[u]}):o[u];return Bs(this,"shape",l),l},checks:[]});return Gi(t,a)}function pS(e,t,r){const n=qi(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new e({type:"nonoptional",innerType:i[a]});return Bs(this,"shape",s),s}});return Gi(t,n)}function da(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function ha(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Yl(e){return typeof e=="string"?e:e==null?void 0:e.message}function Di(e,t,r){var i,s,a,o,l,u;const n={...e,path:e.path??[]};if(!e.message){const c=Yl((a=(s=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,e))??Yl((o=t==null?void 0:t.error)==null?void 0:o.call(t,e))??Yl((l=r.customError)==null?void 0:l.call(r,e))??Yl((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";n.message=c}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Xm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Qo(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const U6=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Dh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},H6=X("$ZodError",U6),V6=X("$ZodError",U6,{Parent:Error});function gS(e,t=r=>r.message){const r={},n=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function bS(e,t=r=>r.message){const r={_errors:[]},n=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let a=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(s))):a[l]=a[l]||{_errors:[]},a=a[l],o++}}};return n(e),r}const Qm=e=>(t,r,n,i)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ba;if(a.issues.length){const o=new((i==null?void 0:i.Err)??e)(a.issues.map(l=>Di(l,s,Li())));throw $6(o,i==null?void 0:i.callee),o}return a.value},Jm=e=>async(t,r,n,i)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((i==null?void 0:i.Err)??e)(a.issues.map(l=>Di(l,s,Li())));throw $6(o,i==null?void 0:i.callee),o}return a.value},e0=e=>(t,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ba;return s.issues.length?{success:!1,error:new(e??H6)(s.issues.map(a=>Di(a,i,Li())))}:{success:!0,data:s.value}},yS=e0(V6),t0=e=>async(t,r,n)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Di(a,i,Li())))}:{success:!0,data:s.value}},vS=t0(V6),xS=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qm(e)(t,r,i)},ES=e=>(t,r,n)=>Qm(e)(t,r,n),_S=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Jm(e)(t,r,i)},TS=e=>async(t,r,n)=>Jm(e)(t,r,n),wS=e=>(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return e0(e)(t,r,i)},kS=e=>(t,r,n)=>e0(e)(t,r,n),SS=e=>async(t,r,n)=>{const i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return t0(e)(t,r,i)},AS=e=>async(t,r,n)=>t0(e)(t,r,n),CS=/^[cC][^\s-]{8,}$/,IS=/^[0-9a-z]+$/,NS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RS=/^[0-9a-vA-V]{20}$/,PS=/^[A-Za-z0-9]{27}$/,OS=/^[a-zA-Z0-9_-]{21}$/,LS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,DS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_g=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,MS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function FS(){return new RegExp(BS,"u")}const zS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$S=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,US=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q6=/^[A-Za-z0-9_-]*$/,VS=/^\+[1-9]\d{6,14}$/,G6="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",qS=new RegExp(`^${G6}$`);function W6(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function GS(e){return new RegExp(`^${W6(e)}$`)}function WS(e){const t=W6({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${G6}T(?:${n})$`)}const ZS=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},YS=/^-?\d+$/,Z6=/^-?\d+(?:\.\d+)?$/,KS=/^(?:true|false)$/i,XS=/^null$/i,QS=/^[^A-Z]*$/,JS=/^[^a-z]*$/,xr=X("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Y6={number:"number",bigint:"bigint",object:"date"},K6=X("$ZodCheckLessThan",(e,t)=>{xr.init(e,t);const r=Y6[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),X6=X("$ZodCheckGreaterThan",(e,t)=>{xr.init(e,t);const r=Y6[typeof t.value];e._zod.onattach.push(n=>{const i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eA=X("$ZodCheckMultipleOf",(e,t)=>{xr.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):nS(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),tA=X("$ZodCheckNumberFormat",(e,t)=>{var a;xr.init(e,t),t.format=t.format||"float64";const r=(a=t.format)==null?void 0:a.includes("int"),n=r?"int":"number",[i,s]=lS[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=i,l.maximum=s,r&&(l.pattern=YS)}),e._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>s&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),rA=X("$ZodCheckMaxLength",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const i=n.value;if(i.length<=t.maximum)return;const a=Xm(i);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nA=X("$ZodCheckMinLength",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const i=n.value;if(i.length>=t.minimum)return;const a=Xm(i);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),iA=X("$ZodCheckLengthEquals",(e,t)=>{var r;xr.init(e,t),(r=e._zod.def).when??(r.when=n=>{const i=n.value;return!Ym(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{const i=n.value,s=i.length;if(s===t.length)return;const a=Xm(i),o=s>t.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),r0=X("$ZodCheckStringFormat",(e,t)=>{var r,n;xr.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),sA=X("$ZodCheckRegex",(e,t)=>{r0.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),aA=X("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=QS),r0.init(e,t)}),oA=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=JS),r0.init(e,t)}),lA=X("$ZodCheckIncludes",(e,t)=>{xr.init(e,t);const r=Ia(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),uA=X("$ZodCheckStartsWith",(e,t)=>{xr.init(e,t);const r=new RegExp(`^${Ia(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),cA=X("$ZodCheckEndsWith",(e,t)=>{xr.init(e,t);const r=new RegExp(`.*${Ia(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),dA=X("$ZodCheckOverwrite",(e,t)=>{xr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class hA{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
3
3
  `).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...r,i.join(`
4
4
  `))}}const fA={major:4,minor:3,patch:6},ht=X("$ZodType",(e,t)=>{var i;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fA;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,l,u)=>{let c=da(o),d;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(o))continue}else if(c)continue;const f=o.issues.length,m=h._zod.check(o);if(m instanceof Promise&&(u==null?void 0:u.async)===!1)throw new ba;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,o.issues.length!==f&&(c||(c=da(o,f)))});else{if(o.issues.length===f)continue;c||(c=da(o,f))}}return d?d.then(()=>o):o},a=(o,l,u)=>{if(da(o))return o.aborted=!0,o;const c=s(l,n,u);if(c instanceof Promise){if(u.async===!1)throw new ba;return c.then(d=>e._zod.parse(d,u))}return e._zod.parse(c,u)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(d=>a(d,o,l)):a(c,o,l)}const u=e._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new ba;return u.then(c=>s(c,n,l))}return s(u,n,l)}}Ye(e,"~standard",()=>({validate:s=>{var a;try{const o=yS(e,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return vS(e,s).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),ep=X("$ZodString",(e,t)=>{var r;ht.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??ZS(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),bt=X("$ZodStringFormat",(e,t)=>{r0.init(e,t),ep.init(e,t)}),mA=X("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=DS),bt.init(e,t)}),pA=X("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=_g(n))}else t.pattern??(t.pattern=_g());bt.init(e,t)}),gA=X("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=MS),bt.init(e,t)}),bA=X("$ZodURL",(e,t)=>{bt.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),yA=X("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=FS()),bt.init(e,t)}),vA=X("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=OS),bt.init(e,t)}),xA=X("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=CS),bt.init(e,t)}),EA=X("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=IS),bt.init(e,t)}),_A=X("$ZodULID",(e,t)=>{t.pattern??(t.pattern=NS),bt.init(e,t)}),TA=X("$ZodXID",(e,t)=>{t.pattern??(t.pattern=RS),bt.init(e,t)}),wA=X("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=PS),bt.init(e,t)}),kA=X("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=WS(t)),bt.init(e,t)}),SA=X("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qS),bt.init(e,t)}),AA=X("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=GS(t)),bt.init(e,t)}),CA=X("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=LS),bt.init(e,t)}),IA=X("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=zS),bt.init(e,t),e._zod.bag.format="ipv4"}),NA=X("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$S),bt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),RA=X("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=jS),bt.init(e,t)}),PA=X("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=US),bt.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,s]=n;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Q6(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const OA=X("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=HS),bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Q6(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function LA(e){if(!q6.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Q6(r)}const DA=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=q6),bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{LA(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),MA=X("$ZodE164",(e,t)=>{t.pattern??(t.pattern=VS),bt.init(e,t)});function BA(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const FA=X("$ZodJWT",(e,t)=>{bt.init(e,t),e._zod.check=r=>{BA(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),J6=X("$ZodNumber",(e,t)=>{ht.init(e,t),e._zod.pattern=e._zod.bag.pattern??Z6,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}}),zA=X("$ZodNumberFormat",(e,t)=>{tA.init(e,t),J6.init(e,t)}),$A=X("$ZodBoolean",(e,t)=>{ht.init(e,t),e._zod.pattern=KS,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jA=X("$ZodNull",(e,t)=>{ht.init(e,t),e._zod.pattern=XS,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),UA=X("$ZodUnknown",(e,t)=>{ht.init(e,t),e._zod.parse=r=>r}),HA=X("$ZodNever",(e,t)=>{ht.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Tg(e,t,r){e.issues.length&&t.issues.push(...ha(r,e.issues)),t.value[r]=e.value}const VA=X("$ZodArray",(e,t)=>{ht.init(e,t),e._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const o=i[a],l=t.element._zod.run({value:o,issues:[]},n);l instanceof Promise?s.push(l.then(u=>Tg(u,r,a))):Tg(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function Xu(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ha(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function ev(e){var n,i,s,a;const t=Object.keys(e.shape);for(const o of t)if(!((a=(s=(i=(n=e.shape)==null?void 0:n[o])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=oS(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function tv(e,t,r,n,i,s){const a=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,c=l.optout==="optional";for(const d in t){if(o.has(d))continue;if(u==="never"){a.push(d);continue}const h=l.run({value:t[d],issues:[]},n);h instanceof Promise?e.push(h.then(f=>Xu(f,r,d,t,c))):Xu(h,r,d,t,c)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const qA=X("$ZodObject",(e,t)=>{ht.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const o=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...o};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=Jc(()=>ev(t));Ye(e._zod,"propValues",()=>{const o=t.shape,l={};for(const u in o){const c=o[u]._zod;if(c.values){l[u]??(l[u]=new Set);for(const d of c.values)l[u].add(d)}}return l});const i=Xo,s=t.catchall;let a;e._zod.parse=(o,l)=>{a??(a=n.value);const u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),o;o.value={};const c=[],d=a.shape;for(const h of a.keys){const f=d[h],m=f._zod.optout==="optional",b=f._zod.run({value:u[h],issues:[]},l);b instanceof Promise?c.push(b.then(y=>Xu(y,o,h,u,m))):Xu(b,o,h,u,m)}return s?tv(c,u,o,l,n.value,e):c.length?Promise.all(c).then(()=>o):o}}),GA=X("$ZodObjectJIT",(e,t)=>{qA.init(e,t);const r=e._zod.parse,n=Jc(()=>ev(t)),i=h=>{var x;const f=new hA(["shape","payload","ctx"]),m=n.value,b=_=>{const A=Eg(_);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let E=0;for(const _ of m.keys)y[_]=`key_${E++}`;f.write("const newResult = {};");for(const _ of m.keys){const A=y[_],S=Eg(_),I=h[_],N=((x=I==null?void 0:I._zod)==null?void 0:x.optout)==="optional";f.write(`const ${A} = ${b(_)};`),N?f.write(`
5
5
  if (${A}.issues.length) {
@@ -211,7 +211,7 @@ ${S}`,d++;break;case"id":S.includes("\0")||(u=S);break;case"retry":/^\d+$/.test(
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const z5={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};z5.node;const $5=kt(z5),mO=[{id:"free",label:"Free"},{id:"tools",label:"Tools"},{id:"reasoning",label:"Reasoning"},{id:"vision",label:"Vision"},{id:"tee",label:"TEE"}],pO=[{id:"popular",label:"Most sellers"},{id:"price",label:"Cheapest"},{id:"name",label:"Name"}],gO=[{id:"free",label:"Free"},{id:"tools",label:"Tools"},{id:"tee",label:"TEE"}],bO=[{id:"auto",label:"Routing order"},{id:"price",label:"Cheapest"},{id:"trust",label:"Trust"}];function wl(e){return e.inputUsdPerMillion===0&&e.outputUsdPerMillion===0}function oc(e){return e.inputUsdPerMillion===null||e.outputUsdPerMillion===null?Number.POSITIVE_INFINITY:e.inputUsdPerMillion+e.outputUsdPerMillion}function yO(e,t){return t==="free"?e.free:t==="tools"?e.toolUse:t==="reasoning"?e.reasoning:t==="vision"?e.vision:e.tee}function vO(e,t,r){return e.filter(i=>[...t].every(s=>yO(i,s))).sort((i,s)=>r==="price"?oc(i)-oc(s)||s.offers-i.offers:r==="name"?i.name.localeCompare(s.name):s.offers-i.offers||i.name.localeCompare(s.name))}function xO(e){const t=new Map;for(const r of(e==null?void 0:e.candidates)??[])t.set(r.peerId.toLowerCase(),{rank:r.rank,eligible:r.eligible,reasons:r.reasons});return t}function j5(e){return e!=null&&e.modelAllowed?[...e.candidates].filter(t=>t.eligible&&t.rank!==null).sort((t,r)=>(t.rank??0)-(r.rank??0))[0]??null:null}function EO(e,t){return t==="free"?wl(e):t==="tools"?e.toolUse:e.tee}function _O(e,t,r,n){const i=e.filter(a=>[...t].every(o=>EO(a,o))),s=(a,o)=>(o.reputation??-1)-(a.reputation??-1);return i.sort((a,o)=>{if(r==="price")return oc(a)-oc(o)||s(a,o);if(r==="trust")return s(a,o);const l=n.get(a.peerId),u=n.get(o.peerId),c=d=>d!=null&&d.eligible&&d.rank!==null?d.rank:Number.POSITIVE_INFINITY;return c(l)-c(u)||s(a,o)})}const ib=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sb=Qc,ap=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return sb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const c=r==null?void 0:r[u],d=s==null?void 0:s[u];if(c===null)return null;const h=ib(c)||ib(d);return i[u][h]}),o=r&&Object.entries(r).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:h,...f}=c;return Object.entries(f).every(m=>{let[b,y]=m;return Array.isArray(y)?y.includes({...s,...o}[b]):{...s,...o}[b]===y})?[...u,d,h]:u},[]);return sb(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},TO=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},wO=(e,t)=>({classGroupId:e,validator:t}),U5=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),lc="-",ab=[],kO="arbitrary..",SO=e=>{const t=CO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return AO(a);const o=a.split(lc),l=o[0]===""&&o.length>1?1:0;return H5(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=n[a],u=r[a];return l?u?TO(u,l):l:u||ab}return r[a]||ab}}},H5=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],s=r.nextPart.get(i);if(s){const u=H5(e,t+1,s);if(u)return u}const a=r.validators;if(a===null)return;const o=t===0?e.join(lc):e.slice(t).join(lc),l=a.length;for(let u=0;u<l;u++){const c=a[u];if(c.validator(o))return c.classGroupId}},AO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?kO+n:void 0})(),CO=e=>{const{theme:t,classGroups:r}=e;return IO(r,t)},IO=(e,t)=>{const r=U5();for(const n in e){const i=e[n];op(i,r,n,t)}return r},op=(e,t,r,n)=>{const i=e.length;for(let s=0;s<i;s++){const a=e[s];NO(a,t,r,n)}},NO=(e,t,r,n)=>{if(typeof e=="string"){RO(e,t,r);return}if(typeof e=="function"){PO(e,t,r,n);return}OO(e,t,r,n)},RO=(e,t,r)=>{const n=e===""?t:V5(t,e);n.classGroupId=r},PO=(e,t,r,n)=>{if(LO(e)){op(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(wO(r,e))},OO=(e,t,r,n)=>{const i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[o,l]=i[a];op(l,V5(t,o),r,n)}},V5=(e,t)=>{let r=e;const n=t.split(lc),i=n.length;for(let s=0;s<i;s++){const a=n[s];let o=r.nextPart.get(a);o||(o=U5(),r.nextPart.set(a,o)),r=o}return r},LO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(s,a)=>{r[s]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let a=r[s];if(a!==void 0)return a;if((a=n[s])!==void 0)return i(s,a),a},set(s,a){s in r?r[s]=a:i(s,a)}}},Vh="!",ob=":",MO=[],lb=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),BO=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const s=[];let a=0,o=0,l=0,u;const c=i.length;for(let b=0;b<c;b++){const y=i[b];if(a===0&&o===0){if(y===ob){s.push(i.slice(l,b)),l=b+1;continue}if(y==="/"){u=b;continue}}y==="["?a++:y==="]"?a--:y==="("?o++:y===")"&&o--}const d=s.length===0?i:i.slice(l);let h=d,f=!1;d.endsWith(Vh)?(h=d.slice(0,-1),f=!0):d.startsWith(Vh)&&(h=d.slice(1),f=!0);const m=u&&u>l?u-l:void 0;return lb(s,f,h,m)};if(t){const i=t+ob,s=n;n=a=>a.startsWith(i)?s(a.slice(i.length)):lb(MO,!1,a,void 0,!0)}if(r){const i=n;n=s=>r({className:s,parseClassName:i})}return n},FO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let s=0;s<r.length;s++){const a=r[s],o=a[0]==="[",l=t.has(a);o||l?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(a)):i.push(a)}return i.length>0&&(i.sort(),n.push(...i)),n}},zO=e=>({cache:DO(e.cacheSize),parseClassName:BO(e),sortModifiers:FO(e),postfixLookupClassGroupIds:$O(e),...SO(e)}),$O=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},jO=/\s+/,UO=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(jO);let u="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{isExternal:h,modifiers:f,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:y}=r(d);if(h){u=d+(u.length>0?" "+u:u);continue}let E=!!y,w;if(E){const I=b.substring(0,y);w=n(I);const N=w&&a[w]?n(b):void 0;N&&N!==w&&(w=N,E=!1)}else w=n(b);if(!w){if(!E){u=d+(u.length>0?" "+u:u);continue}if(w=n(b),!w){u=d+(u.length>0?" "+u:u);continue}E=!1}const x=f.length===0?"":f.length===1?f[0]:s(f).join(":"),_=m?x+Vh:x,A=_+w;if(o.indexOf(A)>-1)continue;o.push(A);const S=i(w,E);for(let I=0;I<S.length;++I){const N=S[I];o.push(_+N)}u=d+(u.length>0?" "+u:u)}return u},HO=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=q5(r))&&(i&&(i+=" "),i+=n);return i},q5=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=q5(e[n]))&&(r&&(r+=" "),r+=t);return r},VO=(e,...t)=>{let r,n,i,s;const a=l=>{const u=t.reduce((c,d)=>d(c),e());return r=zO(u),n=r.cache.get,i=r.cache.set,s=o,o(l)},o=l=>{const u=n(l);if(u)return u;const c=UO(l,r);return i(l,c),c};return s=a,(...l)=>s(HO(...l))},qO=[],Pt=e=>{const t=r=>r[e]||qO;return t.isThemeGetter=!0,t.themeKey=e,t},G5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,W5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,YO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,KO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fi=e=>GO.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),yn=e=>!!e&&Number.isInteger(Number(e)),ld=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),Hn=e=>WO.test(e),Z5=()=>!0,QO=e=>ZO.test(e)&&!YO.test(e),lp=()=>!1,JO=e=>KO.test(e),eL=e=>XO.test(e),tL=e=>!be(e)&&!ye(e),rL=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),nL=e=>Wi(e,X5,lp),be=e=>G5.test(e),ns=e=>Wi(e,Q5,QO),ub=e=>Wi(e,dL,Ve),iL=e=>Wi(e,ex,Z5),sL=e=>Wi(e,J5,lp),cb=e=>Wi(e,Y5,lp),aL=e=>Wi(e,K5,eL),Jl=e=>Wi(e,tx,JO),ye=e=>W5.test(e),fo=e=>Fs(e,Q5),oL=e=>Fs(e,J5),db=e=>Fs(e,Y5),lL=e=>Fs(e,X5),uL=e=>Fs(e,K5),eu=e=>Fs(e,tx,!0),cL=e=>Fs(e,ex,!0),Wi=(e,t,r)=>{const n=G5.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Fs=(e,t,r=!1)=>{const n=W5.exec(e);return n?n[1]?t(n[1]):r:!1},Y5=e=>e==="position"||e==="percentage",K5=e=>e==="image"||e==="url",X5=e=>e==="length"||e==="size"||e==="bg-size",Q5=e=>e==="length",dL=e=>e==="number",J5=e=>e==="family-name",ex=e=>e==="number"||e==="weight",tx=e=>e==="shadow",hL=()=>{const e=Pt("color"),t=Pt("font"),r=Pt("text"),n=Pt("font-weight"),i=Pt("tracking"),s=Pt("leading"),a=Pt("breakpoint"),o=Pt("container"),l=Pt("spacing"),u=Pt("radius"),c=Pt("shadow"),d=Pt("inset-shadow"),h=Pt("text-shadow"),f=Pt("drop-shadow"),m=Pt("blur"),b=Pt("perspective"),y=Pt("aspect"),E=Pt("ease"),w=Pt("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[..._(),ye,be],S=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],N=()=>[ye,be,l],U=()=>[fi,"full","auto",...N()],z=()=>[yn,"none","subgrid",ye,be],Z=()=>["auto",{span:["full",yn,ye,be]},yn,ye,be],V=()=>[yn,"auto",ye,be],ae=()=>["auto","min","max","fr",ye,be],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],de=()=>["auto",...N()],xe=()=>[fi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],Ue=()=>[o,fi,"screen","full","dvw","lvw","svw","min","max","fit",...N()],He=()=>[fi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],L=()=>[e,ye,be],Re=()=>[..._(),db,cb,{position:[ye,be]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",lL,nL,{size:[ye,be]}],pe=()=>[ld,fo,ns],oe=()=>["","none","full",u,ye,be],fe=()=>["",Ve,fo,ns],Ae=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ve,ld,db,cb],Le=()=>["","none",m,ye,be],et=()=>["none",Ve,ye,be],Te=()=>["none",Ve,ye,be],Ke=()=>[Ve,ye,be],ot=()=>[fi,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hn],breakpoint:[Hn],color:[Z5],container:[Hn],"drop-shadow":[Hn],ease:["in","out","in-out"],font:[tL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hn],shadow:[Hn],spacing:["px",Ve],text:[Hn],"text-shadow":[Hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fi,be,ye,y]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,be]}],"container-named":[rL],columns:[{columns:[Ve,"auto",be,ye,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[yn,"auto",ye,be]}],basis:[{basis:[fi,"full","auto",o,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,fi,"auto","initial","none",be]}],grow:[{grow:["",Ve,ye,be]}],shrink:[{shrink:["",Ve,ye,be]}],order:[{order:[yn,"first","last","none",ye,be]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:de()}],mx:[{mx:de()}],my:[{my:de()}],ms:[{ms:de()}],me:[{me:de()}],mbs:[{mbs:de()}],mbe:[{mbe:de()}],mt:[{mt:de()}],mr:[{mr:de()}],mb:[{mb:de()}],ml:[{ml:de()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:xe()}],"inline-size":[{inline:["auto",...Ue()]}],"min-inline-size":[{"min-inline":["auto",...Ue()]}],"max-inline-size":[{"max-inline":["none",...Ue()]}],"block-size":[{block:["auto",...He()]}],"min-block-size":[{"min-block":["auto",...He()]}],"max-block-size":[{"max-block":["none",...He()]}],w:[{w:[o,"screen",...xe()]}],"min-w":[{"min-w":[o,"screen","none",...xe()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...xe()]}],h:[{h:["screen","lh",...xe()]}],"min-h":[{"min-h":["screen","lh","none",...xe()]}],"max-h":[{"max-h":["screen","lh","none",...xe()]}],"font-size":[{text:["base",r,fo,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,cL,iL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ld,be]}],"font-family":[{font:[oL,sL,t]}],"font-features":[{"font-features":[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ye,be]}],"line-clamp":[{"line-clamp":[Ve,"none",ye,ub]}],leading:[{leading:["none",s,...N()]}],"list-image":[{"list-image":["none",ye,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",ye,ns]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Ve,"auto",ye,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[yn,ye,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Re()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yn,ye,be],radial:["",ye,be],conic:["",yn,ye,be]},uL,aL]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,ye,be]}],"outline-w":[{outline:["",Ve,fo,ns]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","inner","none",c,eu,Jl]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,eu,Jl]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Ve,ns]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,eu,Jl]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Ve,ye,be]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ye,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Re()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,be]}],filter:[{filter:["","none",ye,be]}],blur:[{blur:Le()}],brightness:[{brightness:[Ve,ye,be]}],contrast:[{contrast:[Ve,ye,be]}],"drop-shadow":[{"drop-shadow":["","none",f,eu,Jl]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Ve,ye,be]}],"hue-rotate":[{"hue-rotate":[Ve,ye,be]}],invert:[{invert:["",Ve,ye,be]}],saturate:[{saturate:[Ve,ye,be]}],sepia:[{sepia:["",Ve,ye,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,be]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,ye,be]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,ye,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,ye,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,ye,be]}],"backdrop-invert":[{"backdrop-invert":["",Ve,ye,be]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,ye,be]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,ye,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,ye,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",ye,be]}],ease:[{ease:["linear","initial",E,ye,be]}],delay:[{delay:[Ve,ye,be]}],animate:[{animate:["none",w,ye,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ye,be]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[ye,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[yn,ye,be]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,be]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Ve,fo,ns,ub]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},up=VO(hL);function Ie(...e){return up(Qc(e))}var fL=Object.defineProperty,cp=(e,t)=>fL(e,"name",{value:t,configurable:!0});function qh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}cp(qh,"setRef");function Ns(...e){return t=>{let r=!1;const n=e.map(i=>{const s=qh(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():qh(e[i],null)}}}}cp(Ns,"composeRefs");function si(...e){return k.useCallback(Ns(...e),e)}cp(si,"useComposedRefs");var mL=Object.defineProperty,Xr=(e,t)=>mL(e,"name",{value:t,configurable:!0});function i0(e){const t=k.forwardRef((r,n)=>{let{children:i,...s}=r,a=null,o=!1;const l=[];Gh(i)&&typeof tu=="function"&&(i=tu(i._payload)),k.Children.forEach(i,h=>{var f;if(sx(h)){o=!0;const m=h;let b="child"in m.props?m.props.child:m.props.children;Gh(b)&&typeof tu=="function"&&(b=tu(b._payload)),a=bL(m,b),l.push((f=a==null?void 0:a.props)==null?void 0:f.children)}else l.push(h)}),a?a=k.cloneElement(a,void 0,l):!o&&k.Children.count(i)===1&&k.isValidElement(i)&&(a=i);const u=a?ix(a):void 0,c=si(n,u);if(!a){if(i||i===0)throw new Error(o?xL(e):vL(e));return i}const d=nx(s,a.props??{});return a.type!==k.Fragment&&(d.ref=n?c:u),k.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Xr(i0,"createSlot");var pL=i0("Slot"),rx=Symbol.for("radix.slottable");function gL(e){const t=Xr(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=rx,t}Xr(gL,"createSlottable");var bL=Xr((e,t)=>{if("child"in e.props){const r=e.props.child;return k.isValidElement(r)?k.cloneElement(r,void 0,e.props.children(r.props.children)):null}return k.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function nx(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"?r[n]=[i,s].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=ox(s,i))}return{...e,...r}}Xr(nx,"mergeProps");function ix(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Xr(ix,"getElementRef");function sx(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rx}Xr(sx,"isSlottable");var yL=Symbol.for("react.lazy");function Gh(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yL&&"_payload"in e&&ax(e._payload)}Xr(Gh,"isLazyComponent");function ax(e){return typeof e=="object"&&e!==null&&"then"in e}Xr(ax,"isPromiseLike");function ox(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Xr(ox,"concatAriaDescribedby");var vL=Xr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xL=Xr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tu=Ms[" use ".trim().toString()],EL=Object.defineProperty,_L=(e,t)=>EL(e,"name",{value:t,configurable:!0}),TL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rn=TL.reduce((e,t)=>{const r=i0(`Primitive.${t}`),n=k.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lx(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}_L(lx,"dispatchDiscreteCustomEvent");var wL=Object.defineProperty,jr=(e,t)=>wL(e,"name",{value:t,configurable:!0});function kL(e,t){const r=k.createContext(t);r.displayName=e+"Context";const n=jr(s=>{const{children:a,...o}=s,l=k.useMemo(()=>o,Object.values(o));return v.jsx(r.Provider,{value:l,children:a})},"Provider");n.displayName=e+"Provider";function i(s,a={}){const{optional:o=!1}=a,l=k.useContext(r);if(l)return l;if(t!==void 0)return t;if(!o)throw new Error(`\`${s}\` must be used within \`${e}\``)}return jr(i,"useContext"),[n,i]}jr(kL,"createContext");function dp(e,t=[]){let r=[];function n(s,a){const o=k.createContext(a);o.displayName=s+"Context";const l=r.length;r=[...r,a];const u=jr(d=>{var E;const{scope:h,children:f,...m}=d,b=((E=h==null?void 0:h[e])==null?void 0:E[l])||o,y=k.useMemo(()=>m,Object.values(m));return v.jsx(b.Provider,{value:y,children:f})},"Provider");u.displayName=s+"Provider";function c(d,h,f={}){var E;const{optional:m=!1}=f,b=((E=h==null?void 0:h[e])==null?void 0:E[l])||o,y=k.useContext(b);if(y)return y;if(a!==void 0)return a;if(!m)throw new Error(`\`${d}\` must be used within \`${s}\``)}return jr(c,"useContext"),[u,c]}jr(n,"createContext");const i=jr(()=>{const s=r.map(a=>k.createContext(a));return jr(function(o){const l=(o==null?void 0:o[e])||s;return k.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])},"useScope")},"createScope");return i.scopeName=e,[n,ux(i,...t)]}jr(dp,"createContextScope");function ux(...e){const t=e[0];if(e.length===1)return t;const r=jr(()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return jr(function(s){const a=n.reduce((o,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...o,...d}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}jr(ux,"composeContextScopes");var SL=Object.defineProperty,Ua=(e,t)=>SL(e,"name",{value:t,configurable:!0}),cx=!!(typeof window<"u"&&window.document&&window.document.createElement);function In(e,t,{checkForDefaultPrevented:r=!0}={}){return Ua(function(i){if(e==null||e(i),r===!1||!i||!i.defaultPrevented)return t==null?void 0:t(i)},"handleEvent")}Ua(In,"composeEventHandlers");function AL(e){var t;if(!cx)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Ua(AL,"getOwnerWindow");function Wh(e){if(!cx)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ua(Wh,"getOwnerDocument");function dx(e,t=!1){const{activeElement:r}=Wh(e);if(!(r!=null&&r.nodeName))return null;if(hx(r)&&r.contentDocument)return dx(r.contentDocument.body,t);if(t){const n=r.getAttribute("aria-activedescendant");if(n){const i=Wh(r).getElementById(n);if(i)return i}}return r}Ua(dx,"getActiveElement");function hx(e){return e.tagName==="IFRAME"}Ua(hx,"isFrame");var Mi=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},CL=Object.defineProperty,IL=(e,t)=>CL(e,"name",{value:t,configurable:!0}),hb=Ms[" useEffectEvent ".trim().toString()],fb=Ms[" useInsertionEffect ".trim().toString()];function fx(e){if(typeof hb=="function")return hb(e);const t=k.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof fb=="function"?fb(()=>{t.current=e}):Mi(()=>{t.current=e}),k.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}IL(fx,"useEffectEvent");var NL=Object.defineProperty,kl=(e,t)=>NL(e,"name",{value:t,configurable:!0}),RL=Ms[" useInsertionEffect ".trim().toString()]||Mi;function Jo({prop:e,defaultProp:t,onChange:r=kl(()=>{},"onChange"),caller:n}){const[i,s,a]=mx({defaultProp:t,onChange:r}),o=e!==void 0,l=o?e:i,u=k.useCallback(c=>{var d;if(o){const h=px(c)?c(e):c;h!==e&&((d=a.current)==null||d.call(a,h))}else s(c)},[o,e,s,a]);return[l,u]}kl(Jo,"useControllableState");function mx({defaultProp:e,onChange:t}){const[r,n]=k.useState(e),i=k.useRef(r),s=k.useRef(t);return RL(()=>{s.current=t},[t]),k.useEffect(()=>{var a;i.current!==r&&((a=s.current)==null||a.call(s,r),i.current=r)},[r,i]),[r,n,s]}kl(mx,"useUncontrolledState");function px(e){return typeof e=="function"}kl(px,"isFunction");var mb=Symbol("RADIX:SYNC_STATE");function PL(e,t,r,n){const{prop:i,defaultProp:s,onChange:a,caller:o}=t,l=i!==void 0,u=fx(a),c=[{...r,state:s}];n&&c.push(n);const[d,h]=k.useReducer((y,E)=>{if(E.type===mb)return{...y,state:E.state};const w=e(y,E);return l&&!Object.is(w.state,y.state)&&u(w.state),w},...c),f=d.state,m=k.useRef(f);k.useEffect(()=>{m.current!==f&&(m.current=f,l||u(f))},[f,m,l]);const b=k.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return k.useEffect(()=>{l&&!Object.is(i,d.state)&&h({type:mb,state:i})},[i,d.state,l]),[b,h]}kl(PL,"useControllableStateReducer");var OL=Object.defineProperty,ri=(e,t)=>OL(e,"name",{value:t,configurable:!0});function gx(e,t){return k.useReducer((r,n)=>t[r][n]??r,e)}ri(gx,"useStateMachine");var s0=ri(e=>{const{present:t,children:r}=e,n=bx(t),i=typeof r=="function"?r({present:n.isPresent}):k.Children.only(r),s=yx(n.ref,vx(i));return typeof r=="function"||n.isPresent?k.cloneElement(i,{ref:s}):null},"Presence");function bx(e){const[t,r]=k.useState(),n=k.useRef(null),i=k.useRef(e),s=k.useRef("none"),a=k.useRef(void 0),o=e?"mounted":"unmounted",[l,u]=gx(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{l==="mounted"?(s.current=a.current??ia(n.current),a.current=void 0):s.current="none"},[l]),Mi(()=>{const c=n.current,d=i.current;if(d!==e){const f=s.current,m=ia(c);e?(a.current=m,u("MOUNT")):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Mi(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,h=ri(m=>{const y=ia(n.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(u("ANIMATION_END"),!i.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},"handleAnimationEnd"),f=ri(m=>{m.target===t&&(s.current=ia(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:k.useCallback(c=>{if(c){const d=getComputedStyle(c);n.current=d,a.current=ia(d)}else n.current=null;r(c)},[])}}ri(bx,"usePresence");function Zh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ri(Zh,"setRef");function yx(...e){const t=k.useRef(e);return t.current=e,k.useCallback(r=>{const n=t.current;let i=!1;const s=n.map(a=>{const o=Zh(a,r);return!i&&typeof o=="function"&&(i=!0),o});if(i)return()=>{for(let a=0;a<s.length;a++){const o=s[a];typeof o=="function"?o():Zh(n[a],null)}}},[])}ri(yx,"useStableComposedRefs");function ia(e){return(e==null?void 0:e.animationName)||"none"}ri(ia,"getAnimationName");function vx(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}ri(vx,"getElementRef");var LL=Object.defineProperty,DL=(e,t)=>LL(e,"name",{value:t,configurable:!0}),ML=Ms[" useId ".trim().toString()]||(()=>{}),BL=0;function Oo(e){const[t,r]=k.useState(ML());return Mi(()=>{e||r(n=>n??String(BL++))},[e]),e||(t?`radix-${t}`:"")}DL(Oo,"useId");var FL=Object.defineProperty,Sl=(e,t)=>FL(e,"name",{value:t,configurable:!0}),hp="Collapsible",[zL,m0e]=dp(hp),[$L,fp]=zL(hp),jL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,open:i,defaultOpen:s,disabled:a,onOpenChange:o,...l}=t,[u,c]=Jo({prop:i,defaultProp:s??!1,onChange:o,caller:hp});return v.jsx($L,{scope:n,disabled:a,contentId:Oo(),open:u,onOpenToggle:k.useCallback(()=>c(d=>!d),[c]),children:v.jsx(Rn.div,{"data-state":a0(u),"data-disabled":a?"":void 0,...l,ref:r})})},"Collapsible")),UL="CollapsibleTrigger",HL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,...i}=t,s=fp(UL,n);return v.jsx(Rn.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":a0(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...i,ref:r,onClick:In(t.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),xx="CollapsibleContent",VL=k.forwardRef(Sl(function(t,r){const{forceMount:n,...i}=t,s=fp(xx,t.__scopeCollapsible);return v.jsx(s0,{present:n||s.open,children:({present:a})=>v.jsx(qL,{...i,ref:r,present:a})})},"CollapsibleContent")),qL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,present:i,children:s,...a}=t,o=fp(xx,n),[l,u]=k.useState(i),c=k.useRef(null),d=si(r,c),h=k.useRef(0),f=h.current,m=k.useRef(0),b=m.current,y=o.open||l,E=k.useRef(y),w=k.useRef(void 0);return k.useEffect(()=>{const x=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(x)},[]),Mi(()=>{const x=c.current;if(x){w.current=w.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const _=x.getBoundingClientRect();h.current=_.height,m.current=_.width,E.current||(x.style.transitionDuration=w.current.transitionDuration,x.style.animationName=w.current.animationName),u(i)}},[o.open,i]),v.jsx(Rn.div,{"data-state":a0(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y,...a,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...t.style},children:y&&s})},"CollapsibleContentImpl"));function a0(e){return e?"open":"closed"}Sl(a0,"getState");var GL=Object.defineProperty,WL=(e,t)=>GL(e,"name",{value:t,configurable:!0});function Na(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}WL(Na,"useCallbackRef");var ZL=Object.defineProperty,qt=(e,t)=>ZL(e,"name",{value:t,configurable:!0}),Yh="dismissableLayer.update",YL="dismissableLayer.pointerDownOutside",KL="dismissableLayer.focusOutside",pb,Ex=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),XL=k.forwardRef(qt(function(t,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...c}=t,d=k.useContext(Ex),[h,f]=k.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=k.useState({}),y=si(r,f),E=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?E.indexOf(w):-1,_=h?E.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,S=_>=x,I=k.useRef(!1),N=Tx(V=>{a==null||a(V),l==null||l(V),V.defaultPrevented||u==null||u()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(V=>{if(!(V instanceof Node))return!1;const ae=[...d.branches].some(J=>J.contains(V));return S&&!ae},[d.branches,S])}),U=wx(V=>{if(i&&I.current)return;const ae=V.target;[...d.branches].some(Y=>Y.contains(ae))||(o==null||o(V),l==null||l(V),V.defaultPrevented||u==null||u())},m),z=h?_===E.length-1:!1,Z=Na(V=>{V.key==="Escape"&&(s==null||s(V),!V.defaultPrevented&&u&&(V.preventDefault(),u()))});return k.useEffect(()=>{if(z)return m.addEventListener("keydown",Z,{capture:!0}),()=>m.removeEventListener("keydown",Z,{capture:!0})},[m,z,Z]),k.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pb=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Kh(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(h),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=pb))}},[h,m,n,d]),k.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Kh())},[h,d]),k.useEffect(()=>{const V=qt(()=>b({}),"handleUpdate");return document.addEventListener(Yh,V),()=>document.removeEventListener(Yh,V)},[]),v.jsx(Rn.div,{...c,ref:y,style:{pointerEvents:A?S?"auto":"none":void 0,...t.style},onFocusCapture:In(t.onFocusCapture,U.onFocusCapture),onBlurCapture:In(t.onBlurCapture,U.onBlurCapture),onPointerDownCapture:In(t.onPointerDownCapture,N.onPointerDownCapture)})},"DismissableLayer"));function _x(){const e=k.useContext(Ex),[t,r]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}qt(_x,"useDismissableLayerSurface");var QL=qt(()=>!0,"IS_TRUE");function Tx(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=QL}=t,o=Na(e),l=k.useRef(!1),u=k.useRef(!1),c=k.useRef(new Map),d=k.useRef(()=>{});return k.useEffect(()=>{function h(){u.current=!1,i.current=!1,c.current.clear()}qt(h,"resetOutsideInteraction");function f(){return Array.from(c.current.values()).some(Boolean)}qt(f,"isOutsideInteractionIntercepted");function m(x){if(!u.current)return;const _=x.target;_ instanceof Node&&[...s].some(S=>S.contains(_))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}qt(m,"handleInteractionCapture");function b(x){u.current&&c.current.set(x.type,!1)}qt(b,"handleInteractionBubble");const y=qt(x=>{if(x.target&&!l.current){let _=function(){r.removeEventListener("click",d.current);const S=f();h(),S||mp(YL,o,A,{discrete:!0})};if(qt(_,"handleAndDispatchPointerDownOutsideEvent"),!a(x.target)){r.removeEventListener("click",d.current),h(),l.current=!1;return}const A={originalEvent:x};u.current=!0,i.current=n&&x.button===0,c.current.clear(),!n||x.button!==0?_():(r.removeEventListener("click",d.current),d.current=_,r.addEventListener("click",d.current,{once:!0}))}else r.removeEventListener("click",d.current),h();l.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of E)r.addEventListener(x,m,!0),r.addEventListener(x,b);const w=window.setTimeout(()=>{r.addEventListener("pointerdown",y)},0);return()=>{window.clearTimeout(w),r.removeEventListener("pointerdown",y),r.removeEventListener("click",d.current);for(const x of E)r.removeEventListener(x,m,!0),r.removeEventListener(x,b)}},[r,o,n,i,s,a]),{onPointerDownCapture:qt(()=>l.current=!0,"onPointerDownCapture")}}qt(Tx,"usePointerDownOutside");function wx(e,t=globalThis==null?void 0:globalThis.document){const r=Na(e),n=k.useRef(!1);return k.useEffect(()=>{const i=qt(s=>{s.target&&!n.current&&mp(KL,r,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:qt(()=>n.current=!0,"onFocusCapture"),onBlurCapture:qt(()=>n.current=!1,"onBlurCapture")}}qt(wx,"useFocusOutside");function Kh(){const e=new CustomEvent(Yh);document.dispatchEvent(e)}qt(Kh,"dispatchUpdate");function mp(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?lx(i,s):i.dispatchEvent(s)}qt(mp,"handleAndDispatchCustomEvent");var JL=Object.defineProperty,At=(e,t)=>JL(e,"name",{value:t,configurable:!0}),ud="focusScope.autoFocusOnMount",cd="focusScope.autoFocusOnUnmount",gb={bubbles:!1,cancelable:!0},eD=k.forwardRef(At(function(t,r){const{loop:n=!1,trapped:i=!1,branches:s,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=t,[u,c]=k.useState(null),d=Na(a),h=Na(o),f=k.useRef(null),m=si(r,c),b=k.useRef(s);k.useEffect(()=>{b.current=s});const y=k.useCallback(x=>{var _;return x?u!=null&&u.contains(x)?!0:!!((_=b.current)!=null&&_.some(A=>A.contains(x))):!1},[u]),E=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(i){let x=function(I){if(E.paused||!u)return;const N=I.target;y(N)?f.current=N:Zn(f.current,{select:!0})},_=function(I){if(E.paused||!u)return;const N=I.relatedTarget;N!==null&&(y(N)||Zn(f.current,{select:!0}))},A=function(I){if(document.activeElement===document.body)for(const U of I)U.removedNodes.length>0&&Zn(u)};At(x,"handleFocusIn"),At(_,"handleFocusOut"),At(A,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",_);const S=new MutationObserver(A);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",_),S.disconnect()}}},[i,u,E.paused,y]),k.useEffect(()=>{if(u){bb.add(E);const x=document.activeElement;if(!u.contains(x)){const A=new CustomEvent(ud,gb);u.addEventListener(ud,d),u.dispatchEvent(A),A.defaultPrevented||(Cx(Ox(pp(u)),{select:!0}),document.activeElement===x&&Zn(u))}return()=>{u.removeEventListener(ud,d),setTimeout(()=>{const A=new CustomEvent(cd,gb);u.addEventListener(cd,h),u.dispatchEvent(A),A.defaultPrevented||Zn(x??document.body,{select:!0}),u.removeEventListener(cd,h),bb.remove(E)},0)}}},[u,d,h,E]);const w=k.useCallback(x=>{if(!n&&!i||E.paused)return;const _=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,A=document.activeElement;if(_&&A){const S=x.currentTarget,[I,N]=Ix(S);I&&N?!x.shiftKey&&A===N?(x.preventDefault(),n&&Zn(I,{select:!0})):x.shiftKey&&A===I&&(x.preventDefault(),n&&Zn(N,{select:!0})):A===S&&x.preventDefault()}},[n,i,E.paused]);return v.jsx(Rn.div,{tabIndex:-1,...l,ref:m,onKeyDown:w})},"FocusScope")),kx=k.createContext(null);function Sx({registry:e,children:t}){return e?v.jsx(kx.Provider,{value:e,children:t}):t}At(Sx,"FocusScopeBranchProvider");function Ax(){const[e,t]=k.useState([]),r=k.useMemo(()=>({add:At(n=>t(i=>i.includes(n)?i:[...i,n]),"add"),remove:At(n=>t(i=>i.filter(s=>s!==n)),"remove")}),[]);return{nodes:e,registry:r}}At(Ax,"useFocusScopeBranchRegistry");function tD(e){const t=k.useContext(kx);k.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}At(tD,"useFocusScopeBranch");function Cx(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Zn(n,{select:t}),document.activeElement!==r)return}At(Cx,"focusFirst");function Ix(e){const t=pp(e),r=Xh(t,e),n=Xh(t.reverse(),e);return[r,n]}At(Ix,"getTabbableEdges");function pp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:At(n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}At(pp,"getTabbableCandidates");function Xh(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):Nx(n,{upTo:t})))return n}At(Xh,"findVisible");function Nx(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}At(Nx,"isHidden");function Rx(e){return e instanceof HTMLInputElement&&"select"in e}At(Rx,"isSelectableInput");function Zn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Rx(e)&&t&&e.select()}}At(Zn,"focus");var bb=Px();function Px(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Qh(e,t),e.unshift(t)},remove(t){var r;e=Qh(e,t),(r=e[0])==null||r.resume()}}}At(Px,"createFocusScopesStack");function Qh(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}At(Qh,"arrayRemove");function Ox(e){return e.filter(t=>t.tagName!=="A")}At(Ox,"removeLinks");var rD=Object.defineProperty,nD=(e,t)=>rD(e,"name",{value:t,configurable:!0}),iD=k.forwardRef(nD(function(t,r){var l;const{container:n,...i}=t,[s,a]=k.useState(!1);Mi(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?$a.createPortal(v.jsx(Rn.div,{...i,ref:r}),o):null},"Portal")),sD=Object.defineProperty,gp=(e,t)=>sD(e,"name",{value:t,configurable:!0}),ru=0,vn=null;function aD(e){return bp(),e.children}gp(aD,"FocusGuards");function bp(){k.useEffect(()=>{vn||(vn={start:Jh(),end:Jh()});const{start:e,end:t}=vn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ru++,()=>{ru===1&&(vn==null||vn.start.remove(),vn==null||vn.end.remove(),vn=null),ru=Math.max(0,ru-1)}},[])}gp(bp,"useFocusGuards");function Jh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}gp(Jh,"createFocusGuard");var oD=Object.defineProperty,Or=(e,t)=>oD(e,"name",{value:t,configurable:!0}),yp="Dialog",[Lx,p0e]=dp(yp),[lD,Pn]=Lx(yp),Dx=Or(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=k.useRef(null),l=k.useRef(null),{nodes:u,registry:c}=Ax(),[d,h]=Jo({prop:n,defaultProp:i??!1,onChange:s,caller:yp}),[f,m]=k.useState(0),[b,y]=k.useState(0);return v.jsx(lD,{scope:t,triggerRef:o,contentRef:l,contentId:Oo(),titleId:Oo(),descriptionId:Oo(),titlePresent:f>0,descriptionPresent:b>0,setTitleCount:m,setDescriptionCount:y,open:d,onOpenChange:h,onOpenToggle:k.useCallback(()=>h(E=>!E),[h]),modal:a,branchNodes:u,branchRegistry:c,children:r})},"Dialog"),uD="DialogTrigger",cD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(uD,n),a=si(r,s.triggerRef);return v.jsx(Rn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":o0(s.open),...i,ref:a,onClick:In(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Mx="DialogPortal",[dD,Bx]=Lx(Mx,{forceMount:void 0}),Fx=Or(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=Pn(Mx,t);return v.jsx(dD,{scope:t,forceMount:r,children:k.Children.map(n,a=>v.jsx(s0,{present:r||s.open,children:v.jsx(iD,{asChild:!0,container:i,children:a})}))})},"DialogPortal"),ef="DialogOverlay",zx=k.forwardRef(Or(function(t,r){const n=Bx(ef,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,a=Pn(ef,t.__scopeDialog);return a.modal?v.jsx(s0,{present:i||a.open,children:v.jsx(fD,{...s,ref:r})}):null},"DialogOverlay")),hD=i0("DialogOverlay.RemoveScroll"),fD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(ef,n),a=_x(),o=si(r,a);return v.jsx(q9,{as:hD,allowPinchZoom:!0,shards:k.useMemo(()=>[s.contentRef,...s.branchNodes.map(l=>({current:l}))],[s.contentRef,s.branchNodes]),children:v.jsx(Rn.div,{"data-state":o0(s.open),...i,ref:o,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),el="DialogContent",$x=k.forwardRef(Or(function(t,r){const n=Bx(el,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,a=Pn(el,t.__scopeDialog);return v.jsx(s0,{present:i||a.open,children:a.modal?v.jsx(mD,{...s,ref:r}):v.jsx(pD,{...s,ref:r})})},"DialogContent")),mD=k.forwardRef(Or(function(t,r){const n=Pn(el,t.__scopeDialog),i=k.useRef(null),s=si(r,n.contentRef,i);return k.useEffect(()=>{const a=i.current;if(a)return G9(a)},[]),v.jsx(jx,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:In(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:In(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:In(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),pD=k.forwardRef(Or(function(t,r){const n=Pn(el,t.__scopeDialog),i=k.useRef(!1),s=k.useRef(!1);return v.jsx(jx,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,a),a.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:a=>{var u,c;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),jx=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,"aria-describedby":o,children:l,...u}=t,c=Pn(el,n);return bp(),v.jsx(Sx,{registry:c.branchRegistry,children:v.jsx(eD,{asChild:!0,loop:!0,trapped:i,branches:c.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:a,children:v.jsx(XL,{role:"dialog",id:c.contentId,"aria-labelledby":c.titlePresent?c.titleId:void 0,"aria-describedby":c.descriptionPresent?Ux(o,c.descriptionId):o,"data-state":o0(c.open),...u,ref:r,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1),children:l})})})},"DialogContentImpl")),gD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn("DialogTitle",n),{setTitleCount:a}=s;return Mi(()=>(a(o=>o+1),()=>a(o=>o-1)),[a]),v.jsx(Rn.h2,{id:s.titleId,...i,ref:r})},"DialogTitle")),bD="DialogClose",yD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(bD,n);return v.jsx(Rn.button,{type:"button",...i,ref:r,onClick:In(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ux(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Or(Ux,"concatAriaDescribedby");function o0(e){return e?"open":"closed"}Or(o0,"getState");const vD=ap("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Hr({className:e,variant:t="default",size:r="default",asChild:n=!1,...i}){const s=n?pL:"button";return v.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:Ie(vD({variant:t,size:r,className:e})),...i})}/*!---------------------------------------------------------------------------------------------
214
+ */const z5={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};z5.node;const $5=kt(z5),mO=[{id:"free",label:"Free"},{id:"tools",label:"Tools"},{id:"reasoning",label:"Reasoning"},{id:"vision",label:"Vision"},{id:"tee",label:"TEE"}],pO=[{id:"popular",label:"Most sellers"},{id:"price",label:"Cheapest"},{id:"name",label:"Name"}],gO=[{id:"free",label:"Free"},{id:"tools",label:"Tools"},{id:"tee",label:"TEE"}],bO=[{id:"auto",label:"Routing order"},{id:"price",label:"Cheapest"},{id:"trust",label:"Trust"}];function wl(e){return e.inputUsdPerMillion===0&&e.outputUsdPerMillion===0}function oc(e){return e.inputUsdPerMillion===null||e.outputUsdPerMillion===null?Number.POSITIVE_INFINITY:e.inputUsdPerMillion+e.outputUsdPerMillion}function yO(e,t){return t==="free"?e.free:t==="tools"?e.toolUse:t==="reasoning"?e.reasoning:t==="vision"?e.vision:e.tee}function vO(e,t,r){return e.filter(i=>[...t].every(s=>yO(i,s))).sort((i,s)=>r==="price"?oc(i)-oc(s)||s.offers-i.offers:r==="name"?i.name.localeCompare(s.name):s.offers-i.offers||i.name.localeCompare(s.name))}function xO(e){const t=new Map;for(const r of(e==null?void 0:e.candidates)??[])t.set(r.peerId.toLowerCase(),{rank:r.rank,eligible:r.eligible,reasons:r.reasons});return t}function j5(e){return e!=null&&e.modelAllowed?[...e.candidates].filter(t=>t.eligible&&t.rank!==null).sort((t,r)=>(t.rank??0)-(r.rank??0))[0]??null:null}function EO(e,t){return t==="free"?wl(e):t==="tools"?e.toolUse:e.tee}function _O(e,t,r,n){const i=e.filter(a=>[...t].every(o=>EO(a,o))),s=(a,o)=>(o.reputation??-1)-(a.reputation??-1);return i.sort((a,o)=>{if(r==="price")return oc(a)-oc(o)||s(a,o);if(r==="trust")return s(a,o);const l=n.get(a.peerId),u=n.get(o.peerId),c=d=>d!=null&&d.eligible&&d.rank!==null?d.rank:Number.POSITIVE_INFINITY;return c(l)-c(u)||s(a,o)})}const ib=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sb=Qc,ap=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return sb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const c=r==null?void 0:r[u],d=s==null?void 0:s[u];if(c===null)return null;const h=ib(c)||ib(d);return i[u][h]}),o=r&&Object.entries(r).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:h,...f}=c;return Object.entries(f).every(m=>{let[b,y]=m;return Array.isArray(y)?y.includes({...s,...o}[b]):{...s,...o}[b]===y})?[...u,d,h]:u},[]);return sb(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},TO=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},wO=(e,t)=>({classGroupId:e,validator:t}),U5=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),lc="-",ab=[],kO="arbitrary..",SO=e=>{const t=CO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return AO(a);const o=a.split(lc),l=o[0]===""&&o.length>1?1:0;return H5(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=n[a],u=r[a];return l?u?TO(u,l):l:u||ab}return r[a]||ab}}},H5=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],s=r.nextPart.get(i);if(s){const u=H5(e,t+1,s);if(u)return u}const a=r.validators;if(a===null)return;const o=t===0?e.join(lc):e.slice(t).join(lc),l=a.length;for(let u=0;u<l;u++){const c=a[u];if(c.validator(o))return c.classGroupId}},AO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?kO+n:void 0})(),CO=e=>{const{theme:t,classGroups:r}=e;return IO(r,t)},IO=(e,t)=>{const r=U5();for(const n in e){const i=e[n];op(i,r,n,t)}return r},op=(e,t,r,n)=>{const i=e.length;for(let s=0;s<i;s++){const a=e[s];NO(a,t,r,n)}},NO=(e,t,r,n)=>{if(typeof e=="string"){RO(e,t,r);return}if(typeof e=="function"){PO(e,t,r,n);return}OO(e,t,r,n)},RO=(e,t,r)=>{const n=e===""?t:V5(t,e);n.classGroupId=r},PO=(e,t,r,n)=>{if(LO(e)){op(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(wO(r,e))},OO=(e,t,r,n)=>{const i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[o,l]=i[a];op(l,V5(t,o),r,n)}},V5=(e,t)=>{let r=e;const n=t.split(lc),i=n.length;for(let s=0;s<i;s++){const a=n[s];let o=r.nextPart.get(a);o||(o=U5(),r.nextPart.set(a,o)),r=o}return r},LO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,DO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(s,a)=>{r[s]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let a=r[s];if(a!==void 0)return a;if((a=n[s])!==void 0)return i(s,a),a},set(s,a){s in r?r[s]=a:i(s,a)}}},Vh="!",ob=":",MO=[],lb=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),BO=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const s=[];let a=0,o=0,l=0,u;const c=i.length;for(let b=0;b<c;b++){const y=i[b];if(a===0&&o===0){if(y===ob){s.push(i.slice(l,b)),l=b+1;continue}if(y==="/"){u=b;continue}}y==="["?a++:y==="]"?a--:y==="("?o++:y===")"&&o--}const d=s.length===0?i:i.slice(l);let h=d,f=!1;d.endsWith(Vh)?(h=d.slice(0,-1),f=!0):d.startsWith(Vh)&&(h=d.slice(1),f=!0);const m=u&&u>l?u-l:void 0;return lb(s,f,h,m)};if(t){const i=t+ob,s=n;n=a=>a.startsWith(i)?s(a.slice(i.length)):lb(MO,!1,a,void 0,!0)}if(r){const i=n;n=s=>r({className:s,parseClassName:i})}return n},FO=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let s=0;s<r.length;s++){const a=r[s],o=a[0]==="[",l=t.has(a);o||l?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(a)):i.push(a)}return i.length>0&&(i.sort(),n.push(...i)),n}},zO=e=>({cache:DO(e.cacheSize),parseClassName:BO(e),sortModifiers:FO(e),postfixLookupClassGroupIds:$O(e),...SO(e)}),$O=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},jO=/\s+/,UO=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(jO);let u="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{isExternal:h,modifiers:f,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:y}=r(d);if(h){u=d+(u.length>0?" "+u:u);continue}let E=!!y,w;if(E){const I=b.substring(0,y);w=n(I);const N=w&&a[w]?n(b):void 0;N&&N!==w&&(w=N,E=!1)}else w=n(b);if(!w){if(!E){u=d+(u.length>0?" "+u:u);continue}if(w=n(b),!w){u=d+(u.length>0?" "+u:u);continue}E=!1}const x=f.length===0?"":f.length===1?f[0]:s(f).join(":"),_=m?x+Vh:x,A=_+w;if(o.indexOf(A)>-1)continue;o.push(A);const S=i(w,E);for(let I=0;I<S.length;++I){const N=S[I];o.push(_+N)}u=d+(u.length>0?" "+u:u)}return u},HO=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=q5(r))&&(i&&(i+=" "),i+=n);return i},q5=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=q5(e[n]))&&(r&&(r+=" "),r+=t);return r},VO=(e,...t)=>{let r,n,i,s;const a=l=>{const u=t.reduce((c,d)=>d(c),e());return r=zO(u),n=r.cache.get,i=r.cache.set,s=o,o(l)},o=l=>{const u=n(l);if(u)return u;const c=UO(l,r);return i(l,c),c};return s=a,(...l)=>s(HO(...l))},qO=[],Pt=e=>{const t=r=>r[e]||qO;return t.isThemeGetter=!0,t.themeKey=e,t},G5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,W5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,YO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,KO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fi=e=>GO.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),yn=e=>!!e&&Number.isInteger(Number(e)),ld=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),Hn=e=>WO.test(e),Z5=()=>!0,QO=e=>ZO.test(e)&&!YO.test(e),lp=()=>!1,JO=e=>KO.test(e),eL=e=>XO.test(e),tL=e=>!be(e)&&!ye(e),rL=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),nL=e=>Wi(e,X5,lp),be=e=>G5.test(e),ns=e=>Wi(e,Q5,QO),ub=e=>Wi(e,dL,Ve),iL=e=>Wi(e,ex,Z5),sL=e=>Wi(e,J5,lp),cb=e=>Wi(e,Y5,lp),aL=e=>Wi(e,K5,eL),Jl=e=>Wi(e,tx,JO),ye=e=>W5.test(e),fo=e=>Fs(e,Q5),oL=e=>Fs(e,J5),db=e=>Fs(e,Y5),lL=e=>Fs(e,X5),uL=e=>Fs(e,K5),eu=e=>Fs(e,tx,!0),cL=e=>Fs(e,ex,!0),Wi=(e,t,r)=>{const n=G5.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Fs=(e,t,r=!1)=>{const n=W5.exec(e);return n?n[1]?t(n[1]):r:!1},Y5=e=>e==="position"||e==="percentage",K5=e=>e==="image"||e==="url",X5=e=>e==="length"||e==="size"||e==="bg-size",Q5=e=>e==="length",dL=e=>e==="number",J5=e=>e==="family-name",ex=e=>e==="number"||e==="weight",tx=e=>e==="shadow",hL=()=>{const e=Pt("color"),t=Pt("font"),r=Pt("text"),n=Pt("font-weight"),i=Pt("tracking"),s=Pt("leading"),a=Pt("breakpoint"),o=Pt("container"),l=Pt("spacing"),u=Pt("radius"),c=Pt("shadow"),d=Pt("inset-shadow"),h=Pt("text-shadow"),f=Pt("drop-shadow"),m=Pt("blur"),b=Pt("perspective"),y=Pt("aspect"),E=Pt("ease"),w=Pt("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[..._(),ye,be],S=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],N=()=>[ye,be,l],U=()=>[fi,"full","auto",...N()],z=()=>[yn,"none","subgrid",ye,be],Z=()=>["auto",{span:["full",yn,ye,be]},yn,ye,be],V=()=>[yn,"auto",ye,be],ae=()=>["auto","min","max","fr",ye,be],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],de=()=>["auto",...N()],xe=()=>[fi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],Ue=()=>[o,fi,"screen","full","dvw","lvw","svw","min","max","fit",...N()],He=()=>[fi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],L=()=>[e,ye,be],Re=()=>[..._(),db,cb,{position:[ye,be]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",lL,nL,{size:[ye,be]}],pe=()=>[ld,fo,ns],oe=()=>["","none","full",u,ye,be],fe=()=>["",Ve,fo,ns],Ae=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ve,ld,db,cb],Le=()=>["","none",m,ye,be],et=()=>["none",Ve,ye,be],Te=()=>["none",Ve,ye,be],Ke=()=>[Ve,ye,be],ot=()=>[fi,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hn],breakpoint:[Hn],color:[Z5],container:[Hn],"drop-shadow":[Hn],ease:["in","out","in-out"],font:[tL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hn],shadow:[Hn],spacing:["px",Ve],text:[Hn],"text-shadow":[Hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fi,be,ye,y]}],container:["container"],"container-type":[{"@container":["","normal","size",ye,be]}],"container-named":[rL],columns:[{columns:[Ve,"auto",be,ye,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[yn,"auto",ye,be]}],basis:[{basis:[fi,"full","auto",o,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,fi,"auto","initial","none",be]}],grow:[{grow:["",Ve,ye,be]}],shrink:[{shrink:["",Ve,ye,be]}],order:[{order:[yn,"first","last","none",ye,be]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:de()}],mx:[{mx:de()}],my:[{my:de()}],ms:[{ms:de()}],me:[{me:de()}],mbs:[{mbs:de()}],mbe:[{mbe:de()}],mt:[{mt:de()}],mr:[{mr:de()}],mb:[{mb:de()}],ml:[{ml:de()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:xe()}],"inline-size":[{inline:["auto",...Ue()]}],"min-inline-size":[{"min-inline":["auto",...Ue()]}],"max-inline-size":[{"max-inline":["none",...Ue()]}],"block-size":[{block:["auto",...He()]}],"min-block-size":[{"min-block":["auto",...He()]}],"max-block-size":[{"max-block":["none",...He()]}],w:[{w:[o,"screen",...xe()]}],"min-w":[{"min-w":[o,"screen","none",...xe()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...xe()]}],h:[{h:["screen","lh",...xe()]}],"min-h":[{"min-h":["screen","lh","none",...xe()]}],"max-h":[{"max-h":["screen","lh","none",...xe()]}],"font-size":[{text:["base",r,fo,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,cL,iL]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ld,be]}],"font-family":[{font:[oL,sL,t]}],"font-features":[{"font-features":[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ye,be]}],"line-clamp":[{"line-clamp":[Ve,"none",ye,ub]}],leading:[{leading:["none",s,...N()]}],"list-image":[{"list-image":["none",ye,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",ye,ns]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Ve,"auto",ye,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[yn,ye,be]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Re()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yn,ye,be],radial:["",ye,be],conic:["",yn,ye,be]},uL,aL]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,ye,be]}],"outline-w":[{outline:["",Ve,fo,ns]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","inner","none",c,eu,Jl]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,eu,Jl]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Ve,ns]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,eu,Jl]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Ve,ye,be]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ye,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Re()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,be]}],filter:[{filter:["","none",ye,be]}],blur:[{blur:Le()}],brightness:[{brightness:[Ve,ye,be]}],contrast:[{contrast:[Ve,ye,be]}],"drop-shadow":[{"drop-shadow":["","none",f,eu,Jl]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Ve,ye,be]}],"hue-rotate":[{"hue-rotate":[Ve,ye,be]}],invert:[{invert:["",Ve,ye,be]}],saturate:[{saturate:[Ve,ye,be]}],sepia:[{sepia:["",Ve,ye,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,be]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,ye,be]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,ye,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,ye,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,ye,be]}],"backdrop-invert":[{"backdrop-invert":["",Ve,ye,be]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,ye,be]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,ye,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,ye,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",ye,be]}],ease:[{ease:["linear","initial",E,ye,be]}],delay:[{delay:[Ve,ye,be]}],animate:[{animate:["none",w,ye,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ye,be]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[ye,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[yn,ye,be]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,be]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Ve,fo,ns,ub]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},up=VO(hL);function Ie(...e){return up(Qc(e))}var fL=Object.defineProperty,cp=(e,t)=>fL(e,"name",{value:t,configurable:!0});function qh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}cp(qh,"setRef");function Ns(...e){return t=>{let r=!1;const n=e.map(i=>{const s=qh(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():qh(e[i],null)}}}}cp(Ns,"composeRefs");function si(...e){return k.useCallback(Ns(...e),e)}cp(si,"useComposedRefs");var mL=Object.defineProperty,Xr=(e,t)=>mL(e,"name",{value:t,configurable:!0});function i0(e){const t=k.forwardRef((r,n)=>{let{children:i,...s}=r,a=null,o=!1;const l=[];Gh(i)&&typeof tu=="function"&&(i=tu(i._payload)),k.Children.forEach(i,h=>{var f;if(sx(h)){o=!0;const m=h;let b="child"in m.props?m.props.child:m.props.children;Gh(b)&&typeof tu=="function"&&(b=tu(b._payload)),a=bL(m,b),l.push((f=a==null?void 0:a.props)==null?void 0:f.children)}else l.push(h)}),a?a=k.cloneElement(a,void 0,l):!o&&k.Children.count(i)===1&&k.isValidElement(i)&&(a=i);const u=a?ix(a):void 0,c=si(n,u);if(!a){if(i||i===0)throw new Error(o?xL(e):vL(e));return i}const d=nx(s,a.props??{});return a.type!==k.Fragment&&(d.ref=n?c:u),k.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}Xr(i0,"createSlot");var pL=i0("Slot"),rx=Symbol.for("radix.slottable");function gL(e){const t=Xr(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=rx,t}Xr(gL,"createSlottable");var bL=Xr((e,t)=>{if("child"in e.props){const r=e.props.child;return k.isValidElement(r)?k.cloneElement(r,void 0,e.props.children(r.props.children)):null}return k.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function nx(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"?r[n]=[i,s].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=ox(s,i))}return{...e,...r}}Xr(nx,"mergeProps");function ix(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Xr(ix,"getElementRef");function sx(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rx}Xr(sx,"isSlottable");var yL=Symbol.for("react.lazy");function Gh(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yL&&"_payload"in e&&ax(e._payload)}Xr(Gh,"isLazyComponent");function ax(e){return typeof e=="object"&&e!==null&&"then"in e}Xr(ax,"isPromiseLike");function ox(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Xr(ox,"concatAriaDescribedby");var vL=Xr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xL=Xr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tu=Ms[" use ".trim().toString()],EL=Object.defineProperty,_L=(e,t)=>EL(e,"name",{value:t,configurable:!0}),TL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rn=TL.reduce((e,t)=>{const r=i0(`Primitive.${t}`),n=k.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lx(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}_L(lx,"dispatchDiscreteCustomEvent");var wL=Object.defineProperty,jr=(e,t)=>wL(e,"name",{value:t,configurable:!0});function kL(e,t){const r=k.createContext(t);r.displayName=e+"Context";const n=jr(s=>{const{children:a,...o}=s,l=k.useMemo(()=>o,Object.values(o));return v.jsx(r.Provider,{value:l,children:a})},"Provider");n.displayName=e+"Provider";function i(s,a={}){const{optional:o=!1}=a,l=k.useContext(r);if(l)return l;if(t!==void 0)return t;if(!o)throw new Error(`\`${s}\` must be used within \`${e}\``)}return jr(i,"useContext"),[n,i]}jr(kL,"createContext");function dp(e,t=[]){let r=[];function n(s,a){const o=k.createContext(a);o.displayName=s+"Context";const l=r.length;r=[...r,a];const u=jr(d=>{var E;const{scope:h,children:f,...m}=d,b=((E=h==null?void 0:h[e])==null?void 0:E[l])||o,y=k.useMemo(()=>m,Object.values(m));return v.jsx(b.Provider,{value:y,children:f})},"Provider");u.displayName=s+"Provider";function c(d,h,f={}){var E;const{optional:m=!1}=f,b=((E=h==null?void 0:h[e])==null?void 0:E[l])||o,y=k.useContext(b);if(y)return y;if(a!==void 0)return a;if(!m)throw new Error(`\`${d}\` must be used within \`${s}\``)}return jr(c,"useContext"),[u,c]}jr(n,"createContext");const i=jr(()=>{const s=r.map(a=>k.createContext(a));return jr(function(o){const l=(o==null?void 0:o[e])||s;return k.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])},"useScope")},"createScope");return i.scopeName=e,[n,ux(i,...t)]}jr(dp,"createContextScope");function ux(...e){const t=e[0];if(e.length===1)return t;const r=jr(()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return jr(function(s){const a=n.reduce((o,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...o,...d}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}jr(ux,"composeContextScopes");var SL=Object.defineProperty,Ua=(e,t)=>SL(e,"name",{value:t,configurable:!0}),cx=!!(typeof window<"u"&&window.document&&window.document.createElement);function In(e,t,{checkForDefaultPrevented:r=!0}={}){return Ua(function(i){if(e==null||e(i),r===!1||!i||!i.defaultPrevented)return t==null?void 0:t(i)},"handleEvent")}Ua(In,"composeEventHandlers");function AL(e){var t;if(!cx)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Ua(AL,"getOwnerWindow");function Wh(e){if(!cx)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ua(Wh,"getOwnerDocument");function dx(e,t=!1){const{activeElement:r}=Wh(e);if(!(r!=null&&r.nodeName))return null;if(hx(r)&&r.contentDocument)return dx(r.contentDocument.body,t);if(t){const n=r.getAttribute("aria-activedescendant");if(n){const i=Wh(r).getElementById(n);if(i)return i}}return r}Ua(dx,"getActiveElement");function hx(e){return e.tagName==="IFRAME"}Ua(hx,"isFrame");var Mi=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},CL=Object.defineProperty,IL=(e,t)=>CL(e,"name",{value:t,configurable:!0}),hb=Ms[" useEffectEvent ".trim().toString()],fb=Ms[" useInsertionEffect ".trim().toString()];function fx(e){if(typeof hb=="function")return hb(e);const t=k.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof fb=="function"?fb(()=>{t.current=e}):Mi(()=>{t.current=e}),k.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}IL(fx,"useEffectEvent");var NL=Object.defineProperty,kl=(e,t)=>NL(e,"name",{value:t,configurable:!0}),RL=Ms[" useInsertionEffect ".trim().toString()]||Mi;function Jo({prop:e,defaultProp:t,onChange:r=kl(()=>{},"onChange"),caller:n}){const[i,s,a]=mx({defaultProp:t,onChange:r}),o=e!==void 0,l=o?e:i,u=k.useCallback(c=>{var d;if(o){const h=px(c)?c(e):c;h!==e&&((d=a.current)==null||d.call(a,h))}else s(c)},[o,e,s,a]);return[l,u]}kl(Jo,"useControllableState");function mx({defaultProp:e,onChange:t}){const[r,n]=k.useState(e),i=k.useRef(r),s=k.useRef(t);return RL(()=>{s.current=t},[t]),k.useEffect(()=>{var a;i.current!==r&&((a=s.current)==null||a.call(s,r),i.current=r)},[r,i]),[r,n,s]}kl(mx,"useUncontrolledState");function px(e){return typeof e=="function"}kl(px,"isFunction");var mb=Symbol("RADIX:SYNC_STATE");function PL(e,t,r,n){const{prop:i,defaultProp:s,onChange:a,caller:o}=t,l=i!==void 0,u=fx(a),c=[{...r,state:s}];n&&c.push(n);const[d,h]=k.useReducer((y,E)=>{if(E.type===mb)return{...y,state:E.state};const w=e(y,E);return l&&!Object.is(w.state,y.state)&&u(w.state),w},...c),f=d.state,m=k.useRef(f);k.useEffect(()=>{m.current!==f&&(m.current=f,l||u(f))},[f,m,l]);const b=k.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return k.useEffect(()=>{l&&!Object.is(i,d.state)&&h({type:mb,state:i})},[i,d.state,l]),[b,h]}kl(PL,"useControllableStateReducer");var OL=Object.defineProperty,ri=(e,t)=>OL(e,"name",{value:t,configurable:!0});function gx(e,t){return k.useReducer((r,n)=>t[r][n]??r,e)}ri(gx,"useStateMachine");var s0=ri(e=>{const{present:t,children:r}=e,n=bx(t),i=typeof r=="function"?r({present:n.isPresent}):k.Children.only(r),s=yx(n.ref,vx(i));return typeof r=="function"||n.isPresent?k.cloneElement(i,{ref:s}):null},"Presence");function bx(e){const[t,r]=k.useState(),n=k.useRef(null),i=k.useRef(e),s=k.useRef("none"),a=k.useRef(void 0),o=e?"mounted":"unmounted",[l,u]=gx(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{l==="mounted"?(s.current=a.current??ia(n.current),a.current=void 0):s.current="none"},[l]),Mi(()=>{const c=n.current,d=i.current;if(d!==e){const f=s.current,m=ia(c);e?(a.current=m,u("MOUNT")):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Mi(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,h=ri(m=>{const y=ia(n.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(u("ANIMATION_END"),!i.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},"handleAnimationEnd"),f=ri(m=>{m.target===t&&(s.current=ia(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:k.useCallback(c=>{if(c){const d=getComputedStyle(c);n.current=d,a.current=ia(d)}else n.current=null;r(c)},[])}}ri(bx,"usePresence");function Zh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ri(Zh,"setRef");function yx(...e){const t=k.useRef(e);return t.current=e,k.useCallback(r=>{const n=t.current;let i=!1;const s=n.map(a=>{const o=Zh(a,r);return!i&&typeof o=="function"&&(i=!0),o});if(i)return()=>{for(let a=0;a<s.length;a++){const o=s[a];typeof o=="function"?o():Zh(n[a],null)}}},[])}ri(yx,"useStableComposedRefs");function ia(e){return(e==null?void 0:e.animationName)||"none"}ri(ia,"getAnimationName");function vx(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}ri(vx,"getElementRef");var LL=Object.defineProperty,DL=(e,t)=>LL(e,"name",{value:t,configurable:!0}),ML=Ms[" useId ".trim().toString()]||(()=>{}),BL=0;function Oo(e){const[t,r]=k.useState(ML());return Mi(()=>{e||r(n=>n??String(BL++))},[e]),e||(t?`radix-${t}`:"")}DL(Oo,"useId");var FL=Object.defineProperty,Sl=(e,t)=>FL(e,"name",{value:t,configurable:!0}),hp="Collapsible",[zL,p0e]=dp(hp),[$L,fp]=zL(hp),jL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,open:i,defaultOpen:s,disabled:a,onOpenChange:o,...l}=t,[u,c]=Jo({prop:i,defaultProp:s??!1,onChange:o,caller:hp});return v.jsx($L,{scope:n,disabled:a,contentId:Oo(),open:u,onOpenToggle:k.useCallback(()=>c(d=>!d),[c]),children:v.jsx(Rn.div,{"data-state":a0(u),"data-disabled":a?"":void 0,...l,ref:r})})},"Collapsible")),UL="CollapsibleTrigger",HL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,...i}=t,s=fp(UL,n);return v.jsx(Rn.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":a0(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...i,ref:r,onClick:In(t.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),xx="CollapsibleContent",VL=k.forwardRef(Sl(function(t,r){const{forceMount:n,...i}=t,s=fp(xx,t.__scopeCollapsible);return v.jsx(s0,{present:n||s.open,children:({present:a})=>v.jsx(qL,{...i,ref:r,present:a})})},"CollapsibleContent")),qL=k.forwardRef(Sl(function(t,r){const{__scopeCollapsible:n,present:i,children:s,...a}=t,o=fp(xx,n),[l,u]=k.useState(i),c=k.useRef(null),d=si(r,c),h=k.useRef(0),f=h.current,m=k.useRef(0),b=m.current,y=o.open||l,E=k.useRef(y),w=k.useRef(void 0);return k.useEffect(()=>{const x=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(x)},[]),Mi(()=>{const x=c.current;if(x){w.current=w.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const _=x.getBoundingClientRect();h.current=_.height,m.current=_.width,E.current||(x.style.transitionDuration=w.current.transitionDuration,x.style.animationName=w.current.animationName),u(i)}},[o.open,i]),v.jsx(Rn.div,{"data-state":a0(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y,...a,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...t.style},children:y&&s})},"CollapsibleContentImpl"));function a0(e){return e?"open":"closed"}Sl(a0,"getState");var GL=Object.defineProperty,WL=(e,t)=>GL(e,"name",{value:t,configurable:!0});function Na(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}WL(Na,"useCallbackRef");var ZL=Object.defineProperty,qt=(e,t)=>ZL(e,"name",{value:t,configurable:!0}),Yh="dismissableLayer.update",YL="dismissableLayer.pointerDownOutside",KL="dismissableLayer.focusOutside",pb,Ex=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),XL=k.forwardRef(qt(function(t,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...c}=t,d=k.useContext(Ex),[h,f]=k.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=k.useState({}),y=si(r,f),E=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?E.indexOf(w):-1,_=h?E.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,S=_>=x,I=k.useRef(!1),N=Tx(V=>{a==null||a(V),l==null||l(V),V.defaultPrevented||u==null||u()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(V=>{if(!(V instanceof Node))return!1;const ae=[...d.branches].some(J=>J.contains(V));return S&&!ae},[d.branches,S])}),U=wx(V=>{if(i&&I.current)return;const ae=V.target;[...d.branches].some(Y=>Y.contains(ae))||(o==null||o(V),l==null||l(V),V.defaultPrevented||u==null||u())},m),z=h?_===E.length-1:!1,Z=Na(V=>{V.key==="Escape"&&(s==null||s(V),!V.defaultPrevented&&u&&(V.preventDefault(),u()))});return k.useEffect(()=>{if(z)return m.addEventListener("keydown",Z,{capture:!0}),()=>m.removeEventListener("keydown",Z,{capture:!0})},[m,z,Z]),k.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pb=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Kh(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(h),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=pb))}},[h,m,n,d]),k.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Kh())},[h,d]),k.useEffect(()=>{const V=qt(()=>b({}),"handleUpdate");return document.addEventListener(Yh,V),()=>document.removeEventListener(Yh,V)},[]),v.jsx(Rn.div,{...c,ref:y,style:{pointerEvents:A?S?"auto":"none":void 0,...t.style},onFocusCapture:In(t.onFocusCapture,U.onFocusCapture),onBlurCapture:In(t.onBlurCapture,U.onBlurCapture),onPointerDownCapture:In(t.onPointerDownCapture,N.onPointerDownCapture)})},"DismissableLayer"));function _x(){const e=k.useContext(Ex),[t,r]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}qt(_x,"useDismissableLayerSurface");var QL=qt(()=>!0,"IS_TRUE");function Tx(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=QL}=t,o=Na(e),l=k.useRef(!1),u=k.useRef(!1),c=k.useRef(new Map),d=k.useRef(()=>{});return k.useEffect(()=>{function h(){u.current=!1,i.current=!1,c.current.clear()}qt(h,"resetOutsideInteraction");function f(){return Array.from(c.current.values()).some(Boolean)}qt(f,"isOutsideInteractionIntercepted");function m(x){if(!u.current)return;const _=x.target;_ instanceof Node&&[...s].some(S=>S.contains(_))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}qt(m,"handleInteractionCapture");function b(x){u.current&&c.current.set(x.type,!1)}qt(b,"handleInteractionBubble");const y=qt(x=>{if(x.target&&!l.current){let _=function(){r.removeEventListener("click",d.current);const S=f();h(),S||mp(YL,o,A,{discrete:!0})};if(qt(_,"handleAndDispatchPointerDownOutsideEvent"),!a(x.target)){r.removeEventListener("click",d.current),h(),l.current=!1;return}const A={originalEvent:x};u.current=!0,i.current=n&&x.button===0,c.current.clear(),!n||x.button!==0?_():(r.removeEventListener("click",d.current),d.current=_,r.addEventListener("click",d.current,{once:!0}))}else r.removeEventListener("click",d.current),h();l.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of E)r.addEventListener(x,m,!0),r.addEventListener(x,b);const w=window.setTimeout(()=>{r.addEventListener("pointerdown",y)},0);return()=>{window.clearTimeout(w),r.removeEventListener("pointerdown",y),r.removeEventListener("click",d.current);for(const x of E)r.removeEventListener(x,m,!0),r.removeEventListener(x,b)}},[r,o,n,i,s,a]),{onPointerDownCapture:qt(()=>l.current=!0,"onPointerDownCapture")}}qt(Tx,"usePointerDownOutside");function wx(e,t=globalThis==null?void 0:globalThis.document){const r=Na(e),n=k.useRef(!1);return k.useEffect(()=>{const i=qt(s=>{s.target&&!n.current&&mp(KL,r,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:qt(()=>n.current=!0,"onFocusCapture"),onBlurCapture:qt(()=>n.current=!1,"onBlurCapture")}}qt(wx,"useFocusOutside");function Kh(){const e=new CustomEvent(Yh);document.dispatchEvent(e)}qt(Kh,"dispatchUpdate");function mp(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?lx(i,s):i.dispatchEvent(s)}qt(mp,"handleAndDispatchCustomEvent");var JL=Object.defineProperty,At=(e,t)=>JL(e,"name",{value:t,configurable:!0}),ud="focusScope.autoFocusOnMount",cd="focusScope.autoFocusOnUnmount",gb={bubbles:!1,cancelable:!0},eD=k.forwardRef(At(function(t,r){const{loop:n=!1,trapped:i=!1,branches:s,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=t,[u,c]=k.useState(null),d=Na(a),h=Na(o),f=k.useRef(null),m=si(r,c),b=k.useRef(s);k.useEffect(()=>{b.current=s});const y=k.useCallback(x=>{var _;return x?u!=null&&u.contains(x)?!0:!!((_=b.current)!=null&&_.some(A=>A.contains(x))):!1},[u]),E=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(i){let x=function(I){if(E.paused||!u)return;const N=I.target;y(N)?f.current=N:Zn(f.current,{select:!0})},_=function(I){if(E.paused||!u)return;const N=I.relatedTarget;N!==null&&(y(N)||Zn(f.current,{select:!0}))},A=function(I){if(document.activeElement===document.body)for(const U of I)U.removedNodes.length>0&&Zn(u)};At(x,"handleFocusIn"),At(_,"handleFocusOut"),At(A,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",_);const S=new MutationObserver(A);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",_),S.disconnect()}}},[i,u,E.paused,y]),k.useEffect(()=>{if(u){bb.add(E);const x=document.activeElement;if(!u.contains(x)){const A=new CustomEvent(ud,gb);u.addEventListener(ud,d),u.dispatchEvent(A),A.defaultPrevented||(Cx(Ox(pp(u)),{select:!0}),document.activeElement===x&&Zn(u))}return()=>{u.removeEventListener(ud,d),setTimeout(()=>{const A=new CustomEvent(cd,gb);u.addEventListener(cd,h),u.dispatchEvent(A),A.defaultPrevented||Zn(x??document.body,{select:!0}),u.removeEventListener(cd,h),bb.remove(E)},0)}}},[u,d,h,E]);const w=k.useCallback(x=>{if(!n&&!i||E.paused)return;const _=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,A=document.activeElement;if(_&&A){const S=x.currentTarget,[I,N]=Ix(S);I&&N?!x.shiftKey&&A===N?(x.preventDefault(),n&&Zn(I,{select:!0})):x.shiftKey&&A===I&&(x.preventDefault(),n&&Zn(N,{select:!0})):A===S&&x.preventDefault()}},[n,i,E.paused]);return v.jsx(Rn.div,{tabIndex:-1,...l,ref:m,onKeyDown:w})},"FocusScope")),kx=k.createContext(null);function Sx({registry:e,children:t}){return e?v.jsx(kx.Provider,{value:e,children:t}):t}At(Sx,"FocusScopeBranchProvider");function Ax(){const[e,t]=k.useState([]),r=k.useMemo(()=>({add:At(n=>t(i=>i.includes(n)?i:[...i,n]),"add"),remove:At(n=>t(i=>i.filter(s=>s!==n)),"remove")}),[]);return{nodes:e,registry:r}}At(Ax,"useFocusScopeBranchRegistry");function tD(e){const t=k.useContext(kx);k.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}At(tD,"useFocusScopeBranch");function Cx(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Zn(n,{select:t}),document.activeElement!==r)return}At(Cx,"focusFirst");function Ix(e){const t=pp(e),r=Xh(t,e),n=Xh(t.reverse(),e);return[r,n]}At(Ix,"getTabbableEdges");function pp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:At(n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}At(pp,"getTabbableCandidates");function Xh(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):Nx(n,{upTo:t})))return n}At(Xh,"findVisible");function Nx(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}At(Nx,"isHidden");function Rx(e){return e instanceof HTMLInputElement&&"select"in e}At(Rx,"isSelectableInput");function Zn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Rx(e)&&t&&e.select()}}At(Zn,"focus");var bb=Px();function Px(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Qh(e,t),e.unshift(t)},remove(t){var r;e=Qh(e,t),(r=e[0])==null||r.resume()}}}At(Px,"createFocusScopesStack");function Qh(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}At(Qh,"arrayRemove");function Ox(e){return e.filter(t=>t.tagName!=="A")}At(Ox,"removeLinks");var rD=Object.defineProperty,nD=(e,t)=>rD(e,"name",{value:t,configurable:!0}),iD=k.forwardRef(nD(function(t,r){var l;const{container:n,...i}=t,[s,a]=k.useState(!1);Mi(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?$a.createPortal(v.jsx(Rn.div,{...i,ref:r}),o):null},"Portal")),sD=Object.defineProperty,gp=(e,t)=>sD(e,"name",{value:t,configurable:!0}),ru=0,vn=null;function aD(e){return bp(),e.children}gp(aD,"FocusGuards");function bp(){k.useEffect(()=>{vn||(vn={start:Jh(),end:Jh()});const{start:e,end:t}=vn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ru++,()=>{ru===1&&(vn==null||vn.start.remove(),vn==null||vn.end.remove(),vn=null),ru=Math.max(0,ru-1)}},[])}gp(bp,"useFocusGuards");function Jh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}gp(Jh,"createFocusGuard");var oD=Object.defineProperty,Or=(e,t)=>oD(e,"name",{value:t,configurable:!0}),yp="Dialog",[Lx,g0e]=dp(yp),[lD,Pn]=Lx(yp),Dx=Or(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=k.useRef(null),l=k.useRef(null),{nodes:u,registry:c}=Ax(),[d,h]=Jo({prop:n,defaultProp:i??!1,onChange:s,caller:yp}),[f,m]=k.useState(0),[b,y]=k.useState(0);return v.jsx(lD,{scope:t,triggerRef:o,contentRef:l,contentId:Oo(),titleId:Oo(),descriptionId:Oo(),titlePresent:f>0,descriptionPresent:b>0,setTitleCount:m,setDescriptionCount:y,open:d,onOpenChange:h,onOpenToggle:k.useCallback(()=>h(E=>!E),[h]),modal:a,branchNodes:u,branchRegistry:c,children:r})},"Dialog"),uD="DialogTrigger",cD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(uD,n),a=si(r,s.triggerRef);return v.jsx(Rn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":o0(s.open),...i,ref:a,onClick:In(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Mx="DialogPortal",[dD,Bx]=Lx(Mx,{forceMount:void 0}),Fx=Or(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=Pn(Mx,t);return v.jsx(dD,{scope:t,forceMount:r,children:k.Children.map(n,a=>v.jsx(s0,{present:r||s.open,children:v.jsx(iD,{asChild:!0,container:i,children:a})}))})},"DialogPortal"),ef="DialogOverlay",zx=k.forwardRef(Or(function(t,r){const n=Bx(ef,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,a=Pn(ef,t.__scopeDialog);return a.modal?v.jsx(s0,{present:i||a.open,children:v.jsx(fD,{...s,ref:r})}):null},"DialogOverlay")),hD=i0("DialogOverlay.RemoveScroll"),fD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(ef,n),a=_x(),o=si(r,a);return v.jsx(q9,{as:hD,allowPinchZoom:!0,shards:k.useMemo(()=>[s.contentRef,...s.branchNodes.map(l=>({current:l}))],[s.contentRef,s.branchNodes]),children:v.jsx(Rn.div,{"data-state":o0(s.open),...i,ref:o,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),el="DialogContent",$x=k.forwardRef(Or(function(t,r){const n=Bx(el,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,a=Pn(el,t.__scopeDialog);return v.jsx(s0,{present:i||a.open,children:a.modal?v.jsx(mD,{...s,ref:r}):v.jsx(pD,{...s,ref:r})})},"DialogContent")),mD=k.forwardRef(Or(function(t,r){const n=Pn(el,t.__scopeDialog),i=k.useRef(null),s=si(r,n.contentRef,i);return k.useEffect(()=>{const a=i.current;if(a)return G9(a)},[]),v.jsx(jx,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:In(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:In(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:In(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),pD=k.forwardRef(Or(function(t,r){const n=Pn(el,t.__scopeDialog),i=k.useRef(!1),s=k.useRef(!1);return v.jsx(jx,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,a),a.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:a=>{var u,c;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),jx=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,"aria-describedby":o,children:l,...u}=t,c=Pn(el,n);return bp(),v.jsx(Sx,{registry:c.branchRegistry,children:v.jsx(eD,{asChild:!0,loop:!0,trapped:i,branches:c.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:a,children:v.jsx(XL,{role:"dialog",id:c.contentId,"aria-labelledby":c.titlePresent?c.titleId:void 0,"aria-describedby":c.descriptionPresent?Ux(o,c.descriptionId):o,"data-state":o0(c.open),...u,ref:r,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1),children:l})})})},"DialogContentImpl")),gD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn("DialogTitle",n),{setTitleCount:a}=s;return Mi(()=>(a(o=>o+1),()=>a(o=>o-1)),[a]),v.jsx(Rn.h2,{id:s.titleId,...i,ref:r})},"DialogTitle")),bD="DialogClose",yD=k.forwardRef(Or(function(t,r){const{__scopeDialog:n,...i}=t,s=Pn(bD,n);return v.jsx(Rn.button,{type:"button",...i,ref:r,onClick:In(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ux(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Or(Ux,"concatAriaDescribedby");function o0(e){return e?"open":"closed"}Or(o0,"getState");const vD=ap("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Hr({className:e,variant:t="default",size:r="default",asChild:n=!1,...i}){const s=n?pL:"button";return v.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:Ie(vD({variant:t,size:r,className:e})),...i})}/*!---------------------------------------------------------------------------------------------
215
215
  * Copyright (c) StackBlitz. All rights reserved.
216
216
  * Licensed under the MIT License. See License.txt in the project root for license information.
217
217
  *--------------------------------------------------------------------------------------------*/const xD={damping:.7,stiffness:.05,mass:1.25},ED=70,_D=1e3/60,TD=350;let l0=!1;var L6;(L6=globalThis.document)==null||L6.addEventListener("mousedown",()=>{l0=!0});var D6;(D6=globalThis.document)==null||D6.addEventListener("mouseup",()=>{l0=!1});var M6;(M6=globalThis.document)==null||M6.addEventListener("click",()=>{l0=!1});const wD=(e={})=>{const[t,r]=k.useState(!1),[n,i]=k.useState(e.initial!==!1),[s,a]=k.useState(!1),o=k.useRef(null);o.current=e;const l=k.useCallback(()=>{var _;if(!l0)return!1;const w=window.getSelection();if(!w||!w.rangeCount)return!1;const x=w.getRangeAt(0);return x.commonAncestorContainer.contains(y.current)||((_=y.current)==null?void 0:_.contains(x.commonAncestorContainer))},[]),u=k.useCallback(w=>{d.isAtBottom=w,i(w)},[]),c=k.useCallback(w=>{d.escapedFromLock=w,r(w)},[]),d=k.useMemo(()=>{let w;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){var x;return((x=y.current)==null?void 0:x.scrollTop)??0},set scrollTop(x){if(y.current){const{scrollBehavior:_}=getComputedStyle(y.current);_!=="auto"&&(y.current.style.scrollBehavior="auto"),y.current.scrollTop=x,d.ignoreScrollToTop=y.current.scrollTop,_!=="auto"&&(y.current.style.scrollBehavior=_)}},get targetScrollTop(){return!y.current||!E.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!E.current)return 0;const{targetScrollTop:x}=this;if(!e.targetScrollTop)return x;if((w==null?void 0:w.targetScrollTop)===x)return w.calculatedScrollTop;const _=Math.max(Math.min(e.targetScrollTop(x,{scrollElement:y.current,contentElement:E.current}),x),0);return w={targetScrollTop:x,calculatedScrollTop:_},requestAnimationFrame(()=>{w=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ED}}},[]),h=k.useCallback((w={})=>{var U;typeof w=="string"&&(w={animation:w}),w.preserveScrollPosition||u(!0);const x=Date.now()+(Number(w.wait)||0),_=hd(o.current,w.animation),{ignoreEscapes:A=!1}=w;let S,I=d.calculatedTargetScrollTop;w.duration instanceof Promise?w.duration.finally(()=>{S=Date.now()}):S=x+(w.duration??0);const N=async()=>{const z=new Promise(requestAnimationFrame).then(()=>{var J;if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:Z}=d,V=performance.now(),ae=(V-(d.lastTick??V))/_D;if(d.animation||(d.animation={behavior:_,promise:z,ignoreEscapes:A}),d.animation.behavior===_&&(d.lastTick=V),l()||x>Date.now())return N();if(Z<Math.min(I,d.calculatedTargetScrollTop)){if(((J=d.animation)==null?void 0:J.behavior)===_){if(_==="instant")return d.scrollTop=d.calculatedTargetScrollTop,N();d.velocity=(_.damping*d.velocity+_.stiffness*d.scrollDifference)/_.mass,d.accumulated+=d.velocity*ae,d.scrollTop+=d.accumulated,d.scrollTop!==Z&&(d.accumulated=0)}return N()}return S>Date.now()?(I=d.calculatedTargetScrollTop,N()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?h({animation:hd(o.current,o.current.resize),ignoreEscapes:A,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return z.then(Z=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),Z))};return w.wait!==!0&&(d.animation=void 0),((U=d.animation)==null?void 0:U.behavior)===_?d.animation.promise:N()},[u,l,d]),f=k.useCallback(()=>{c(!0),u(!1)},[c,u]),m=k.useCallback(({target:w})=>{if(w!==y.current)return;const{scrollTop:x,ignoreScrollToTop:_}=d;let{lastScrollTop:A=x}=d;d.lastScrollTop=x,d.ignoreScrollToTop=void 0,_&&_>x&&(A=_),a(d.isNearBottom),setTimeout(()=>{var N;if(d.resizeDifference||x===_)return;if(l()){c(!0),u(!1);return}const S=x>A,I=x<A;if((N=d.animation)!=null&&N.ignoreEscapes){d.scrollTop=A;return}I&&(c(!0),u(!1)),S&&c(!1),!d.escapedFromLock&&d.isNearBottom&&u(!0)},1)},[c,u,l,d]),b=k.useCallback(({target:w,deltaY:x})=>{var A;let _=w;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===y.current&&x<0&&y.current.scrollHeight>y.current.clientHeight&&!((A=d.animation)!=null&&A.ignoreEscapes)&&(c(!0),u(!1))},[c,u,d]),y=yb(w=>{var x,_;(x=y.current)==null||x.removeEventListener("scroll",m),(_=y.current)==null||_.removeEventListener("wheel",b),w==null||w.addEventListener("scroll",m,{passive:!0}),w==null||w.addEventListener("wheel",b,{passive:!0})},[]),E=yb(w=>{var _,A;if((_=d.resizeObserver)==null||_.disconnect(),d.resizeObserver=void 0,!w)return;let x;d.resizeObserver=new ResizeObserver(([S])=>{const{height:I}=S.contentRect,N=I-(x??I);if(d.resizeDifference=N,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),a(d.isNearBottom),N>=0){const U=hd(o.current,x?o.current.resize:o.current.initial);h({animation:U,wait:!0,preserveScrollPosition:!0,duration:U==="instant"?void 0:TD})}else d.isNearBottom&&(c(!1),u(!0));x=I,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===N&&(d.resizeDifference=0)},1)})}),(A=d.resizeObserver)==null||A.observe(w)},[]);return{contentRef:E,scrollRef:y,scrollToBottom:h,stopScroll:f,isAtBottom:n||s,isNearBottom:s,escapedFromLock:t,state:d}};function yb(e,t){const r=k.useCallback(n=>(r.current=n,e(n)),t);return r}const dd=new Map;function hd(...e){const t={...xD};let r=!1;for(const i of e){if(i==="instant"){r=!0;continue}typeof i=="object"&&(r=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const n=JSON.stringify(t);return dd.has(n)||dd.set(n,Object.freeze(t)),r?"instant":dd.get(n)}/*!---------------------------------------------------------------------------------------------
@@ -368,7 +368,7 @@ XID_Continue XIDC
368
368
  XID_Start XIDS`.split(/\s/).map(e=>[y0(e),e])),r$=new Map([["s",Ft(383)],[Ft(383),"s"]]),n$=new Map([[Ft(223),Ft(7838)],[Ft(107),Ft(8490)],[Ft(229),Ft(8491)],[Ft(969),Ft(8486)]]),i$=new Map([yi(453),yi(456),yi(459),yi(498),...wd(8072,8079),...wd(8088,8095),...wd(8104,8111),yi(8124),yi(8140),yi(8188)]),s$=new Map([["alnum",De`[\p{Alpha}\p{Nd}]`],["alpha",De`\p{Alpha}`],["ascii",De`\p{ASCII}`],["blank",De`[\p{Zs}\t]`],["cntrl",De`\p{Cc}`],["digit",De`\p{Nd}`],["graph",De`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",De`\p{Lower}`],["print",De`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",De`[\p{P}\p{S}]`],["space",De`\p{space}`],["upper",De`\p{Upper}`],["word",De`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",De`\p{AHex}`]]);function a$(e,t){const r=[];for(let n=e;n<=t;n++)r.push(n);return r}function yi(e){const t=Ft(e);return[t.toLowerCase(),t]}function wd(e,t){return a$(e,t).map(r=>yi(r))}var e_=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function o$(e,t){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};t_(e);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:yf(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Do(e,l$,n);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Do(e,u$,s);const a={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return Do(e,c$,a),e._originMap=s.groupOriginByCopy,e._strategy=n.strategy,e}var l$={AbsenceFunction({node:e,parent:t,replaceWith:r}){const{body:n,kind:i}=e;if(i==="repeater"){const s=un();s.body[0].body.push(cs({negate:!0,body:n}),aa("Any"));const a=un();a.body[0].body.push(GE("greedy",0,1/0,s)),r(Tt(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){const i=e.body.filter(s=>s.kind==="flags");for(let s=r+1;s<t.body.length;s++){const a=t.body[s];al(n,a,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){var r;if((r=t.get(e))!=null&&r.length){const n=n_(t.get(e));if(n){const i=un({flags:n});i.body[0].body=e.body,e.body=[Tt(i,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:i,remove:s,replaceWith:a},o){const{kind:l,negate:u}=e,{asciiWordBoundaries:c,avoidSubclass:d,supportedGNodes:h,wordIsAscii:f}=o;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")a(Tt(cs({body:[Rs({body:[mf("string_end")]}),Rs({body:[b0(10)]})]}),t));else if(l==="line_start")a(Tt(qn(De`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(h.has(e))i.flags.sticky=!0,s();else{const m=n[r-1];if(m&&g$(m))a(Tt(cs({negate:!0}),t));else{if(d)throw new Error(De`Uses "\G" in a way that requires a subclass`);a(vi(mf("string_start"),t)),o.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")a(Tt(qn(De`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!c){const m=`(?:(?<=${Vn})(?!${Vn})|(?<!${Vn})(?=${Vn}))`,b=`(?:(?<=${Vn})(?=${Vn})|(?<!${Vn})(?!${Vn}))`;a(Tt(qn(u?b:m),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Sd(r)&&(r=kd(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!Sd(n)&&(n=kd(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){const n=Du({body:[e]});r(Tt(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:i,digitIsAscii:s,spaceIsAscii:a,wordIsAscii:o}){const{kind:l,negate:u,value:c}=e;if(s&&(l==="digit"||c==="digit")){r(vi(gf("digit",{negate:u}),t));return}if(a&&(l==="space"||c==="space")){r(Tt(Ad(qn(e$),u),t));return}if(o&&(l==="word"||c==="word")){r(vi(gf("word",{negate:u}),t));return}if(l==="any")r(vi(aa("Any"),t));else if(l==="digit")r(vi(aa("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(n==="strict")throw new Error(De`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=De`\p{RI}{2}|${d}(?:\u200D${d})*`;r(Tt(qn(De`(?>\r\n|${i?De`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")r(vi(aa("AHex",{negate:u}),t));else if(l==="newline")r(Tt(qn(u?`[^
369
369
  ]`:`(?>\r
370
370
  ?|[
371
- \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${Ft(d.codePointAt(0)-1)}${Ft(d.codePointAt(2)+1)}-􏿿`),r(Tt(qn(`[${d}]`),t))}else r(Tt(Ad(qn(s$.get(c)),u),t));else if(l==="property")Pp.has(y0(c))||(e.key="sc");else if(l==="space")r(vi(aa("space",{negate:u}),t));else if(l==="word")r(Tt(Ad(qn(Vn),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:a}){const{kind:o,flags:l}=e;if(o==="flags")if(!l.enable&&!l.disable)n();else{const u=un({flags:l});u.body[0].body=a(),i(Tt(u,t),{traverse:!0})}else if(o==="keep"){const u=r.body[0],d=r.body.length===1&&HE(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(t.parent!==d||d.body.length>1)throw new Error(De`Uses "\K" in a way that's unsupported`);const h=cs({behind:!0});h.body[0].body=s(),i(Tt(h,t))}else throw new Error(`Unexpected directive kind "${o}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(Tt(cs({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=un();t.body[0].body.push(e.body),e.body=Tt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const a=s_(s.body);a?(n=!0,Array.isArray(a)?r.push(...a):r.push(a)):i=!0}n&&!i&&r.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(De`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Sd(r)&&(r=kd(r,t),e.ref=r)}},u$={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=e;n||r.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:a,openRefs:o,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&o.has(e.number)){const d=vi(a2(e.number),t);l.set(d,o.get(e.number)),r(d);return}o.set(e.number,e),a.set(e.number,[]),e.name&&al(a,e.name,[]);const c=a.get(e.name??e.number);for(let d=0;d<c.length;d++){const h=c[d];if(u===h.node||u&&u===h.origin||e===h.origin){c.splice(d,1);break}}if(a.get(e.number).push({node:e,origin:u}),e.name&&a.get(e.name).push({node:e,origin:u}),e.name){const d=al(s,e.name,new Map);let h=!1;if(u)h=!0;else for(const f of d.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Ec(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:i,ref:s}=e;if(i){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===s||c.number===s)););n.reffedNodesByReferencer.set(e,c);return}const a=n.subroutineRefMap.get(s),o=s===0,l=o?a2(0):r_(a,n.groupOriginByCopy,null);let u=l;if(!o){const c=n_(f$(a,h=>h.type==="Group"&&!!h.flags)),d=c?Ec(n.globalFlags,c):n.globalFlags;d$(d,n.currentFlags)||(u=un({flags:m$(d)}),u.body[0].body.push(l))}r(Tt(u,t),{traverse:!o})}},c$={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const s=n.reffedNodesByReferencer.get(e).filter(a=>h$(a,e));if(!s.length)r(Tt(cs({negate:!0}),t));else if(s.length>1){const a=un({atomic:!0,body:s.reverse().map(o=>Rs({body:[pf(o.number)]}))});r(Tt(a,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=qE();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function t_(e){Do(e,{"*"({node:t,parent:r}){t.parent=r}})}function d$(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function h$(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=i_(r.parent);for(const i of n){if(i===r)break;if(i===e||a_(i,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function r_(e,t,r,n){const i=Array.isArray(e)?[]:{};for(const[s,a]of Object.entries(e))s==="parent"?i.parent=Array.isArray(r)?n:r:a&&typeof a=="object"?i[s]=r_(a,t,i,r):(s==="type"&&a==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=a);return i}function a2(e){const t=WE(e);return t.isRecursive=!0,t}function f$(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function kd(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function n_(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(i=>{var s,a;(s=n.enable)!=null&&s[i]&&(delete r.disable[i],r.enable[i]=!0),(a=n.disable)!=null&&a[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function m$({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function i_(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function s_(e){const t=e.find(r=>r.kind==="search_start"||b$(r,{negate:!1})||!p$(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const i=s_(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function a_(e,t){const r=i_(e)??[];for(const n of r)if(n===t||a_(n,t))return!0;return!1}function p$({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function g$(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function b$(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&HE(e.body[0],{type:"Assertion",kind:"search_start"})}function Sd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function qn(e,t){const n=VE(e,{...t,unicodePropertyMap:Pp}).body;return n.length>1||n[0].body.length>1?un({body:n}):n[0].body[0]}function Ad(e,t){return e.negate=t,e}function vi(e,t){return e.parent=t,e}function Tt(e,t){return t_(e),e.parent=t,e}function y$(e,t){const r=QE(t),n=yf(r.target,"ES2024"),i=yf(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,o=null;if(!i){const f=[e.flags.ignoreCase];Do(e,v$,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?a=!0:o=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!o)};let u=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&a&&o),useFlagMods:i,useFlagV:n,verbose:r.verbose};function d(f){return c.lastNode=u,u=f,Qz(x$[f.type],`Unexpected node type "${f.type}"`)(f,c,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&al(h._captureTransfers,f.transferTo,[]).push(m)}),h}var v$={"*":{enter({node:e},t){if(l2(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Ec({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){l2(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Op(Ft(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),o_(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&e_.has(e.value)&&t.setHasCasedChar()}},x$={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?De`\B`:De`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:i,number:s}=e,a={ignoreCase:t.currentFlags.ignoreCase},o=t.originMap.get(e);return o&&(a.hidden=!0,s>o.number&&(a.transferTo=o.number)),t.captureMap.set(s,a),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=Ft(e),n=Xs(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Op(r)){const i=JE(r);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:i,parent:s}=e;let{body:a}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");cn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(u2)&&(a=[b0(45),...a.filter(u=>!u2(u))]);const o=()=>`[${i?"^":""}${a.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||cn.bugNestedClassIgnoresNegation)&&!i){const c=a.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){const d=un(),h=d.body[0];return d.parent=s,h.parent=d,a=a.filter(f=>!c.includes(f)),e.body=a,a.length?(e.parent=h,h.body.push(e)):d.body.pop(),c.forEach(f=>{const m=Rs({body:[f]});f.parent=m,m.parent=d,d.body.push(m)}),r(d)}}t.inCharClass=!0;const u=o();return t.inCharClass=!1,u}const l=a[0];if(n==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(cn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(r).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return o()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Xs(r,i),a=Xs(n,i),o=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=o_(e);k$(l).forEach(c=>{o.add(Array.isArray(c)?`${Xs(c[0],i)}-${Xs(c[1],i)}`:Xs(c,i))})}return`${s}-${a}${[...o].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":De`[^\n]`;if(e==="digit")return t?De`\D`:De`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&e_.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?De`\P`:De`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?De`\W`:De`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},i,s){const a=i.currentFlags;r&&(i.currentFlags=Ec(a,r));const o=t.map(s).join("|"),l=!i.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!i.useFlagMods||!r)?o:`(?${S$(e,r,i.useFlagMods)}${o})`;return i.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:r},n,i){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,r){return r(e.body)+A$(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:De`\g<${t}&R=${n}>`}},E$=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),_$=new Set(["-","\\","]","^","["]),T$=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),o2=new Map([[9,De`\t`],[10,De`\n`],[11,De`\v`],[12,De`\f`],[13,De`\r`],[8232,De`\u2028`],[8233,De`\u2029`],[65279,De`\uFEFF`]]),w$=new RegExp("^\\p{Cased}$","u");function Op(e){return w$.test(e)}function o_(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,i=e.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let a=n;a<=i;a++){const o=Ft(a);if(!Op(o))continue;const l=JE(o).filter(u=>{const c=u.codePointAt(0);return c<n||c>i});if(l.length&&(s.push(...l),r))break}return s}function Xs(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(o2.has(e))return o2.get(e);if(e<32||e>126&&e<160||e>262143||t&&C$(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?T$:_$:E$,s=Ft(e);return(i.has(s)?"\\":"")+s}function k$(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?n??(n=t[i]):n===null?r.push(t[i]):(r.push([n,t[i]]),n=null);return r}function S$(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:i,disable:s}=t;n=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(s?"-":"")+(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")}return`${n}:`}function A$({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function l2({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function C$(e){return e>47&&e<58}function u2({type:e,value:t}){return e==="Character"&&t===45}var Si,Kn,Es,Ai,_s,_l,vf,Oi,I$=(Oi=class extends RegExp{constructor(r,n,i){var t=(...bde)=>(super(...bde),Ut(this,_l),Ut(this,Si,new Map),Ut(this,Kn,null),Ut(this,Es),Ut(this,Ai,null),Ut(this,_s,null),G(this,"rawOptions",{}),this);const s=!!(i!=null&&i.lazyCompile);if(r instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const a=r;t(a,n),rt(this,Es,a.source),a instanceof Oi&&(rt(this,Si,je(a,Si)),rt(this,Ai,je(a,Ai)),rt(this,_s,je(a,_s)),this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...i};t(s?"":r,n),rt(this,Es,r),rt(this,Si,R$(a.hiddenCaptures,a.transfers)),rt(this,_s,a.strategy),this.rawOptions=i??{}}s||rt(this,Kn,this)}get source(){return je(this,Es)||"(?:)"}exec(r){if(!je(this,Kn)){const{lazyCompile:s,...a}=this.rawOptions;rt(this,Kn,new Oi(je(this,Es),this.flags,a))}const n=this.global||this.sticky,i=this.lastIndex;if(je(this,_s)==="clip_search"&&n&&i){this.lastIndex=0;const s=Zl(this,_l,vf).call(this,r.slice(i));return s&&(N$(s,i,r,this.hasIndices),this.lastIndex+=i),s}return Zl(this,_l,vf).call(this,r)}},Si=new WeakMap,Kn=new WeakMap,Es=new WeakMap,Ai=new WeakMap,_s=new WeakMap,_l=new WeakSet,vf=function(r){je(this,Kn).lastIndex=this.lastIndex;const n=bg(Oi.prototype,this,"exec").call(je(this,Kn),r);if(this.lastIndex=je(this,Kn).lastIndex,!n||!je(this,Si).size)return n;const i=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const a=[0];for(let o=1;o<i.length;o++){const{hidden:l,transferTo:u}=je(this,Si).get(o)??{};if(l?a.push(null):(a.push(n.length),n.push(i[o]),this.hasIndices&&n.indices.push(s[o])),u&&i[o]!==void 0){const c=a[u];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=i[o],this.hasIndices&&(n.indices[c]=s[o]),n.groups){je(this,Ai)||rt(this,Ai,P$(this.source));const d=je(this,Ai).get(u);d&&(n.groups[d]=i[o],this.hasIndices&&(n.indices.groups[d]=s[o]))}}}return n},Oi);function N$(e,t,r,n){if(e.index+=t,e.input=r,n){const i=e.indices;for(let a=0;a<i.length;a++){const o=i[a];o&&(i[a]=[o[0]+t,o[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(a=>{const o=s[a];o&&(s[a]=[o[0]+t,o[1]+t])})}}function R$(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,i]of t)for(const s of i)al(r,s,{}).transferTo=n;return r}function P$(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=t.exec(e);){const{0:a,groups:{capture:o,name:l}}=s;a==="["?n++:n?a==="]"&&n--:o&&(i++,l&&r.set(i,l))}return r}function O$(e,t){const r=L$(e,t);return r.options?new I$(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function L$(e,t){const r=QE(t),n=VE(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Pp}),i=o$(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=y$(i,r),a=Kz(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),o=Zz(a.pattern),l=Wz(o.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),u={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((m,b)=>m-b),d=Array.from(l.captureTransfers),h=i._strategy,f=u.pattern.length>=r.lazyCompileLength;(c.length||d.length||h||f)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function D$(e,t){return O$(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function M$(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=r=>D$(r,{target:t.target})),{createScanner(r){return new YF(r,t)},createString:XF}}var B$=M$({forgiving:!0}),F$=Object.fromEntries(vp.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(r=>[r,e.id])})),Mu=new Set(Object.keys(qx)),c2=e=>{let t=e.trim().toLowerCase();return F$[t]||(Mu.has(t),t)},Cd=new Map,z$=3e5,$$=5e3,j$=64,ei=new Map,xf=0,U$=(e,t)=>{let r=t.tokens.length+Math.ceil(e.length/j$);for(let n of t.tokens)r+=n.length;return r},d2=e=>{let t=ei.get(e);return t&&(ei.delete(e),ei.set(e,t)),t==null?void 0:t.result},h2=e=>{let t=ei.get(e);t&&(ei.delete(e),xf-=t.cost)},H$=(e,t)=>{h2(e);let r=U$(e,t);for(ei.set(e,{cost:r,result:t}),xf+=r;(xf>z$||ei.size>$$)&&ei.size>1;)h2(ei.keys().next().value)},Ef=new Map,V$=4,q$=(e,t)=>{let r=Ef.get(e);if(!r)return;let n=r.findIndex(i=>t.startsWith(i.prefix));return n===-1?void 0:r.splice(n,1)[0]},f2=(e,t)=>{let r=Ef.get(e);r||(r=[],Ef.set(e,r)),r.unshift(t),r.length>V$&&r.pop()},m2=(e,t)=>{if(t!==0)for(let r of e)for(let n of r)n.offset+=t},G$=(e,t,r,n,i)=>{let s=q$(r,t),a=s?s.prefix:"",o=s?s.rows:[],l=s==null?void 0:s.grammarState,u=t.lastIndexOf(`
371
+ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${Ft(d.codePointAt(0)-1)}${Ft(d.codePointAt(2)+1)}-􏿿`),r(Tt(qn(`[${d}]`),t))}else r(Tt(Ad(qn(s$.get(c)),u),t));else if(l==="property")Pp.has(y0(c))||(e.key="sc");else if(l==="space")r(vi(aa("space",{negate:u}),t));else if(l==="word")r(Tt(Ad(qn(Vn),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:a}){const{kind:o,flags:l}=e;if(o==="flags")if(!l.enable&&!l.disable)n();else{const u=un({flags:l});u.body[0].body=a(),i(Tt(u,t),{traverse:!0})}else if(o==="keep"){const u=r.body[0],d=r.body.length===1&&HE(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(t.parent!==d||d.body.length>1)throw new Error(De`Uses "\K" in a way that's unsupported`);const h=cs({behind:!0});h.body[0].body=s(),i(Tt(h,t))}else throw new Error(`Unexpected directive kind "${o}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(Tt(cs({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=un();t.body[0].body.push(e.body),e.body=Tt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,i=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const a=s_(s.body);a?(n=!0,Array.isArray(a)?r.push(...a):r.push(a)):i=!0}n&&!i&&r.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(De`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Sd(r)&&(r=kd(r,t),e.ref=r)}},u$={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=e;n||r.set(e,[...t.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:a,openRefs:o,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&o.has(e.number)){const d=vi(a2(e.number),t);l.set(d,o.get(e.number)),r(d);return}o.set(e.number,e),a.set(e.number,[]),e.name&&al(a,e.name,[]);const c=a.get(e.name??e.number);for(let d=0;d<c.length;d++){const h=c[d];if(u===h.node||u&&u===h.origin||e===h.origin){c.splice(d,1);break}}if(a.get(e.number).push({node:e,origin:u}),e.name&&a.get(e.name).push({node:e,origin:u}),e.name){const d=al(s,e.name,new Map);let h=!1;if(u)h=!0;else for(const f of d.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Ec(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:i,ref:s}=e;if(i){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===s||c.number===s)););n.reffedNodesByReferencer.set(e,c);return}const a=n.subroutineRefMap.get(s),o=s===0,l=o?a2(0):r_(a,n.groupOriginByCopy,null);let u=l;if(!o){const c=n_(f$(a,h=>h.type==="Group"&&!!h.flags)),d=c?Ec(n.globalFlags,c):n.globalFlags;d$(d,n.currentFlags)||(u=un({flags:m$(d)}),u.body[0].body.push(l))}r(Tt(u,t),{traverse:!o})}},c$={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const s=n.reffedNodesByReferencer.get(e).filter(a=>h$(a,e));if(!s.length)r(Tt(cs({negate:!0}),t));else if(s.length>1){const a=un({atomic:!0,body:s.reverse().map(o=>Rs({body:[pf(o.number)]}))});r(Tt(a,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=qE();e.body.at(-1).body.push(i)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function t_(e){Do(e,{"*"({node:t,parent:r}){t.parent=r}})}function d$(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function h$(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=i_(r.parent);for(const i of n){if(i===r)break;if(i===e||a_(i,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function r_(e,t,r,n){const i=Array.isArray(e)?[]:{};for(const[s,a]of Object.entries(e))s==="parent"?i.parent=Array.isArray(r)?n:r:a&&typeof a=="object"?i[s]=r_(a,t,i,r):(s==="type"&&a==="CapturingGroup"&&t.set(i,t.get(e)??e),i[s]=a);return i}function a2(e){const t=WE(e);return t.isRecursive=!0,t}function f$(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function kd(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function n_(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(i=>{var s,a;(s=n.enable)!=null&&s[i]&&(delete r.disable[i],r.enable[i]=!0),(a=n.disable)!=null&&a[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function m$({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function i_(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function s_(e){const t=e.find(r=>r.kind==="search_start"||b$(r,{negate:!1})||!p$(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const i=s_(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function a_(e,t){const r=i_(e)??[];for(const n of r)if(n===t||a_(n,t))return!0;return!1}function p$({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function g$(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function b$(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&HE(e.body[0],{type:"Assertion",kind:"search_start"})}function Sd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function qn(e,t){const n=VE(e,{...t,unicodePropertyMap:Pp}).body;return n.length>1||n[0].body.length>1?un({body:n}):n[0].body[0]}function Ad(e,t){return e.negate=t,e}function vi(e,t){return e.parent=t,e}function Tt(e,t){return t_(e),e.parent=t,e}function y$(e,t){const r=QE(t),n=yf(r.target,"ES2024"),i=yf(r.target,"ES2025"),s=r.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,o=null;if(!i){const f=[e.flags.ignoreCase];Do(e,v$,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?a=!0:o=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!o)};let u=e;const c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&a&&o),useFlagMods:i,useFlagV:n,verbose:r.verbose};function d(f){return c.lastNode=u,u=f,Qz(x$[f.type],`Unexpected node type "${f.type}"`)(f,c,d)}const h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&al(h._captureTransfers,f.transferTo,[]).push(m)}),h}var v$={"*":{enter({node:e},t){if(l2(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Ec({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){l2(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Op(Ft(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),o_(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&e_.has(e.value)&&t.setHasCasedChar()}},x$={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?De`\B`:De`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:i,number:s}=e,a={ignoreCase:t.currentFlags.ignoreCase},o=t.originMap.get(e);return o&&(a.hidden=!0,s>o.number&&(a.transferTo=o.number)),t.captureMap.set(s,a),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=Ft(e),n=Xs(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Op(r)){const i=JE(r);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:i,parent:s}=e;let{body:a}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");cn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(u2)&&(a=[b0(45),...a.filter(u=>!u2(u))]);const o=()=>`[${i?"^":""}${a.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||cn.bugNestedClassIgnoresNegation)&&!i){const c=a.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){const d=un(),h=d.body[0];return d.parent=s,h.parent=d,a=a.filter(f=>!c.includes(f)),e.body=a,a.length?(e.parent=h,h.body.push(e)):d.body.pop(),c.forEach(f=>{const m=Rs({body:[f]});f.parent=m,m.parent=d,d.body.push(m)}),r(d)}}t.inCharClass=!0;const u=o();return t.inCharClass=!1,u}const l=a[0];if(n==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(cn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(r).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return o()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Xs(r,i),a=Xs(n,i),o=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=o_(e);k$(l).forEach(c=>{o.add(Array.isArray(c)?`${Xs(c[0],i)}-${Xs(c[1],i)}`:Xs(c,i))})}return`${s}-${a}${[...o].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":De`[^\n]`;if(e==="digit")return t?De`\D`:De`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&e_.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?De`\P`:De`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?De`\W`:De`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},i,s){const a=i.currentFlags;r&&(i.currentFlags=Ec(a,r));const o=t.map(s).join("|"),l=!i.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!i.useFlagMods||!r)?o:`(?${S$(e,r,i.useFlagMods)}${o})`;return i.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:r},n,i){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,r){return r(e.body)+A$(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:De`\g<${t}&R=${n}>`}},E$=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),_$=new Set(["-","\\","]","^","["]),T$=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),o2=new Map([[9,De`\t`],[10,De`\n`],[11,De`\v`],[12,De`\f`],[13,De`\r`],[8232,De`\u2028`],[8233,De`\u2029`],[65279,De`\uFEFF`]]),w$=new RegExp("^\\p{Cased}$","u");function Op(e){return w$.test(e)}function o_(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,i=e.max.value,s=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return s;for(let a=n;a<=i;a++){const o=Ft(a);if(!Op(o))continue;const l=JE(o).filter(u=>{const c=u.codePointAt(0);return c<n||c>i});if(l.length&&(s.push(...l),r))break}return s}function Xs(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(o2.has(e))return o2.get(e);if(e<32||e>126&&e<160||e>262143||t&&C$(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?T$:_$:E$,s=Ft(e);return(i.has(s)?"\\":"")+s}function k$(e){const t=e.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),r=[];let n=null;for(let i=0;i<t.length;i++)t[i+1]===t[i]+1?n??(n=t[i]):n===null?r.push(t[i]):(r.push([n,t[i]]),n=null);return r}function S$(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:i,disable:s}=t;n=(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")+(s?"-":"")+(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")}return`${n}:`}function A$({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function l2({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function C$(e){return e>47&&e<58}function u2({type:e,value:t}){return e==="Character"&&t===45}var Si,Kn,Es,Ai,_s,_l,vf,Oi,I$=(Oi=class extends RegExp{constructor(r,n,i){var t=(...yde)=>(super(...yde),Ut(this,_l),Ut(this,Si,new Map),Ut(this,Kn,null),Ut(this,Es),Ut(this,Ai,null),Ut(this,_s,null),G(this,"rawOptions",{}),this);const s=!!(i!=null&&i.lazyCompile);if(r instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const a=r;t(a,n),rt(this,Es,a.source),a instanceof Oi&&(rt(this,Si,je(a,Si)),rt(this,Ai,je(a,Ai)),rt(this,_s,je(a,_s)),this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...i};t(s?"":r,n),rt(this,Es,r),rt(this,Si,R$(a.hiddenCaptures,a.transfers)),rt(this,_s,a.strategy),this.rawOptions=i??{}}s||rt(this,Kn,this)}get source(){return je(this,Es)||"(?:)"}exec(r){if(!je(this,Kn)){const{lazyCompile:s,...a}=this.rawOptions;rt(this,Kn,new Oi(je(this,Es),this.flags,a))}const n=this.global||this.sticky,i=this.lastIndex;if(je(this,_s)==="clip_search"&&n&&i){this.lastIndex=0;const s=Zl(this,_l,vf).call(this,r.slice(i));return s&&(N$(s,i,r,this.hasIndices),this.lastIndex+=i),s}return Zl(this,_l,vf).call(this,r)}},Si=new WeakMap,Kn=new WeakMap,Es=new WeakMap,Ai=new WeakMap,_s=new WeakMap,_l=new WeakSet,vf=function(r){je(this,Kn).lastIndex=this.lastIndex;const n=bg(Oi.prototype,this,"exec").call(je(this,Kn),r);if(this.lastIndex=je(this,Kn).lastIndex,!n||!je(this,Si).size)return n;const i=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const a=[0];for(let o=1;o<i.length;o++){const{hidden:l,transferTo:u}=je(this,Si).get(o)??{};if(l?a.push(null):(a.push(n.length),n.push(i[o]),this.hasIndices&&n.indices.push(s[o])),u&&i[o]!==void 0){const c=a[u];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=i[o],this.hasIndices&&(n.indices[c]=s[o]),n.groups){je(this,Ai)||rt(this,Ai,P$(this.source));const d=je(this,Ai).get(u);d&&(n.groups[d]=i[o],this.hasIndices&&(n.indices.groups[d]=s[o]))}}}return n},Oi);function N$(e,t,r,n){if(e.index+=t,e.input=r,n){const i=e.indices;for(let a=0;a<i.length;a++){const o=i[a];o&&(i[a]=[o[0]+t,o[1]+t])}const s=i.groups;s&&Object.keys(s).forEach(a=>{const o=s[a];o&&(s[a]=[o[0]+t,o[1]+t])})}}function R$(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,i]of t)for(const s of i)al(r,s,{}).transferTo=n;return r}function P$(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,s;for(;s=t.exec(e);){const{0:a,groups:{capture:o,name:l}}=s;a==="["?n++:n?a==="]"&&n--:o&&(i++,l&&r.set(i,l))}return r}function O$(e,t){const r=L$(e,t);return r.options?new I$(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function L$(e,t){const r=QE(t),n=VE(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Pp}),i=o$(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),s=y$(i,r),a=Kz(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),o=Zz(a.pattern),l=Wz(o.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),u={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((m,b)=>m-b),d=Array.from(l.captureTransfers),h=i._strategy,f=u.pattern.length>=r.lazyCompileLength;(c.length||d.length||h||f)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function D$(e,t){return O$(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function M$(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||(t.regexConstructor=r=>D$(r,{target:t.target})),{createScanner(r){return new YF(r,t)},createString:XF}}var B$=M$({forgiving:!0}),F$=Object.fromEntries(vp.flatMap(e=>{var t;return((t=e.aliases)!=null?t:[]).map(r=>[r,e.id])})),Mu=new Set(Object.keys(qx)),c2=e=>{let t=e.trim().toLowerCase();return F$[t]||(Mu.has(t),t)},Cd=new Map,z$=3e5,$$=5e3,j$=64,ei=new Map,xf=0,U$=(e,t)=>{let r=t.tokens.length+Math.ceil(e.length/j$);for(let n of t.tokens)r+=n.length;return r},d2=e=>{let t=ei.get(e);return t&&(ei.delete(e),ei.set(e,t)),t==null?void 0:t.result},h2=e=>{let t=ei.get(e);t&&(ei.delete(e),xf-=t.cost)},H$=(e,t)=>{h2(e);let r=U$(e,t);for(ei.set(e,{cost:r,result:t}),xf+=r;(xf>z$||ei.size>$$)&&ei.size>1;)h2(ei.keys().next().value)},Ef=new Map,V$=4,q$=(e,t)=>{let r=Ef.get(e);if(!r)return;let n=r.findIndex(i=>t.startsWith(i.prefix));return n===-1?void 0:r.splice(n,1)[0]},f2=(e,t)=>{let r=Ef.get(e);r||(r=[],Ef.set(e,r)),r.unshift(t),r.length>V$&&r.pop()},m2=(e,t)=>{if(t!==0)for(let r of e)for(let n of r)n.offset+=t},G$=(e,t,r,n,i)=>{let s=q$(r,t),a=s?s.prefix:"",o=s?s.rows:[],l=s==null?void 0:s.grammarState,u=t.lastIndexOf(`
372
372
  `)+1;if(u>a.length){let d=e.codeToTokens(t.slice(a.length,u),{lang:n,themes:i,grammarState:l}),h=d.tokens;h.pop(),m2(h,a.length),o=o.concat(h),l=d.grammarState,a=t.slice(0,u),f2(r,{grammarState:l,prefix:a,rows:o})}else s&&f2(r,s);let c=e.codeToTokens(t.slice(u),{lang:n,themes:i,grammarState:l});return m2(c.tokens,u),{...c,tokens:o.concat(c.tokens)}},_c=e=>{var t;return typeof e=="string"?e:(t=e.name)!=null?t:"custom"},l_=(e,t)=>`${e}-${_c(t[0])}-${_c(t[1])}`,W$=(e,t,r)=>`${t}:${r[0]}:${r[1]}
373
373
  ${e}`,Z$=(e,t)=>{let r=l_(e,t);if(Cd.has(r))return Cd.get(r);let n=BE({themes:t,langs:[e],engine:B$});return Cd.set(r,n),n};function Y$(e={}){var t;let r=(t=e.themes)!=null?t:["github-light","github-dark"];return{name:"shiki",type:"code-highlighter",supportsLanguage(n){let i=c2(n);return Mu.has(i)},getSupportedLanguages(){return Array.from(Mu)},getThemes(){return r},highlight({code:n,language:i,themes:s,isIncomplete:a=!1},o){let l=c2(i),u=[_c(s[0]),_c(s[1])],c=Mu.has(l)?l:"text",d=W$(n,c,u);return d2(d)||(Z$(c,s).then(f=>{let m=f.getLoadedLanguages().includes(l)?l:"text",b=d2(d);b||(b=G$(f,n,`${l_(c,s)}:${m}`,m,{light:u[0],dark:u[1]}),a||H$(d,b)),o==null||o(b)}).catch(f=>{console.error("[Streamdown Code] Failed to highlight code:",f)}),null)}}}var K$=Y$();const p2=/[#.]/g;function X$(e,t){const r=e||"",n={};let i=0,s,a;for(;i<r.length;){p2.lastIndex=i;const o=p2.exec(r),l=r.slice(i,o?o.index:r.length);l&&(s?s==="#"?n.id=l:Array.isArray(n.className)?n.className.push(l):n.className=[l]:a=l,i+=l.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||t||"div",properties:n,children:[]}}function u_(e,t,r){const n=r?tj(r):void 0;function i(s,a,...o){let l;if(s==null){l={type:"root",children:[]};const u=a;o.unshift(u)}else{l=X$(s,t);const u=l.tagName.toLowerCase(),c=n?n.get(u):void 0;if(l.tagName=c||u,Q$(a))o.unshift(a);else for(const[d,h]of Object.entries(a))J$(e,l.properties,d,h)}for(const u of o)_f(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function Q$(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const i=t[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function J$(e,t,r,n){const i=Il(e,r);let s;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;s=n}else typeof n=="boolean"?s=n:typeof n=="string"?i.spaceSeparated?s=Mb(n):i.commaSeparated?s=Db(n):i.commaOrSpaceSeparated?s=Mb(Db(n).join(" ")):s=g2(i,i.property,n):Array.isArray(n)?s=[...n]:s=i.property==="style"?ej(n):String(n);if(Array.isArray(s)){const a=[];for(const o of s)a.push(g2(i,i.property,o));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function _f(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)_f(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?_f(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function g2(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||sl(r)===sl(t)))return!0}return r}function ej(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function tj(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const rj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],c_=u_(Va,"div"),d_=u_(On,"g",rj),An={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nj(e,t){return h_(e,{})||{type:"root",children:[]}}function h_(e,t){const r=ij(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function ij(e,t){switch(e.nodeType){case 1:return lj(e,t);case 3:return aj(e);case 8:return oj(e);case 9:return b2(e,t);case 10:return sj();case 11:return b2(e,t);default:return}}function b2(e,t){return{type:"root",children:f_(e,t)}}function sj(){return{type:"doctype"}}function aj(e){return{type:"text",value:e.nodeValue||""}}function oj(e){return{type:"comment",value:e.nodeValue||""}}function lj(e,t){const r=e.namespaceURI,n=r===An.svg?d_:c_,i=r===An.html?e.tagName.toLowerCase():e.tagName,s=r===An.html&&i==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++l<a.length;)o[a[l]]=e.getAttribute(a[l])||"";return n(i,o,f_(s,t))}function f_(e,t){const r=e.childNodes,n=[];let i=-1;for(;++i<r.length;){const s=h_(r[i],t);s!==void 0&&n.push(s)}return n}new DOMParser;function uj(e,t){const r=cj(e);return nj(r)}function cj(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Rl=(function(e){if(e==null)return mj;if(typeof e=="function")return E0(e);if(typeof e=="object")return Array.isArray(e)?dj(e):hj(e);if(typeof e=="string")return fj(e);throw new Error("Expected function, string, or object as test")});function dj(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Rl(e[r]);return E0(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function hj(e){const t=e;return E0(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function fj(e){return E0(t);function t(r){return r&&r.type===e}}function E0(e){return t;function t(r,n,i){return!!(pj(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function mj(){return!0}function pj(e){return e!==null&&typeof e=="object"&&"type"in e}const y2=(function(e,t,r){const n=Rl(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]}),$s=(function(e){if(e==null)return yj;if(typeof e=="string")return bj(e);if(typeof e=="object")return gj(e);if(typeof e=="function")return Lp(e);throw new Error("Expected function, string, or array as `test`")});function gj(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=$s(e[r]);return Lp(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function bj(e){return Lp(t);function t(r){return r.tagName===e}}function Lp(e){return t;function t(r,n,i){return!!(vj(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function yj(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function vj(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const v2=/\n/g,x2=/[\t ]+/g,Tf=$s("br"),E2=$s(Aj),xj=$s("p"),_2=$s("tr"),Ej=$s(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Sj,Cj]),m_=$s(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function _j(e,t){const r=t||{},n="children"in e?e.children:[],i=m_(e),s=b_(e,{whitespace:r.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(...g_(e,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<n.length;)a.push(...p_(n[o],e,{whitespace:s,breakBefore:o?void 0:i,breakAfter:o<n.length-1?Tf(n[o+1]):i}));const l=[];let u;for(o=-1;++o<a.length;){const c=a[o];typeof c=="number"?u!==void 0&&c>u&&(u=c):c&&(u!==void 0&&u>-1&&l.push(`
374
374
  `.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function p_(e,t,r){return e.type==="element"?Tj(e,t,r):e.type==="text"?r.whitespace==="normal"?g_(e,r):wj(e):[]}function Tj(e,t,r){const n=b_(e,r),i=e.children||[];let s=-1,a=[];if(Ej(e))return a;let o,l;for(Tf(e)||_2(e)&&y2(t,e,_2)?l=`
@@ -752,8 +752,8 @@ ${t}</tr>
752
752
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${kr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,text:n,tokens:i,autolink:s}){let a=s?kr(n,!0):this.parser.parseInline(i),o=_y(t);if(o===null)return a;t=kr(o,s);let l='<a href="'+t+'"';return r&&(l+=' title="'+kr(r)+'"'),l+=">"+a+"</a>",l}image({href:t,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=_y(t);if(s===null)return kr(n);t=s;let a=`<img src="${kr(t)}" alt="${kr(n)}"`;return r&&(a+=` title="${kr(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:kr(t.text)}},C1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},on=class im{constructor(t){G(this,"options");G(this,"renderer");G(this,"textRenderer");this.options=t||Vs,this.options.renderer=this.options.renderer||new Fc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new C1}static parse(t,r){return new im(r).parse(t)}static parseInline(t,r){return new im(r).parseInline(t)}parse(t){var n,i;this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&i[a.type]){let l=a,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){r+=u||"";continue}}let o=a;switch(o.type){case"space":{r+=this.renderer.space(o);break}case"hr":{r+=this.renderer.hr(o);break}case"heading":{r+=this.renderer.heading(o);break}case"code":{r+=this.renderer.code(o);break}case"table":{r+=this.renderer.table(o);break}case"blockquote":{r+=this.renderer.blockquote(o);break}case"list":{r+=this.renderer.list(o);break}case"checkbox":{r+=this.renderer.checkbox(o);break}case"html":{r+=this.renderer.html(o);break}case"def":{r+=this.renderer.def(o);break}case"paragraph":{r+=this.renderer.paragraph(o);break}case"text":{r+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(t,r=this.renderer){var i,s;this.renderer.parser=this;let n="";for(let a=0;a<t.length;a++){let o=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[o.type]){let u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(o.type)){n+=u||"";continue}}let l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},Ru,No=(Ru=class{constructor(e){G(this,"options");G(this,"block");this.options=e||Vs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?zr.lex:zr.lexInline}provideParser(e=this.block){return e?on.parse:on.parseInline}},G(Ru,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),G(Ru,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ru),zte=class{constructor(...t){G(this,"defaults",E1());G(this,"options",this.setOptions);G(this,"parse",this.parseMarkdown(!0));G(this,"parseInline",this.parseMarkdown(!1));G(this,"Parser",on);G(this,"Renderer",Fc);G(this,"TextRenderer",C1);G(this,"Lexer",zr);G(this,"Tokenizer",Bc);G(this,"Hooks",No);this.use(...t)}walkTokens(t,r){var i,s;let n=[];for(let a of t)switch(n=n.concat(r.call(this,a)),a.type){case"table":{let o=a;for(let l of o.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of o.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{let o=a;n=n.concat(this.walkTokens(o.items,r));break}default:{let o=a;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new Fc(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...c)=>{let d=l.apply(s,c);return d===!1&&(d=u.apply(s,c)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Bc(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...c)=>{let d=l.apply(s,c);return d===!1&&(d=u.apply(s,c)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new No;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];No.passThroughHooks.has(a)?s[o]=c=>{if(this.defaults.async&&No.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await l.call(s,c);return u.call(s,h)})();let d=l.call(s,c);return u.call(s,d)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(s,c);return h===!1&&(h=await u.apply(s,c)),h})();let d=l.apply(s,c);return d===!1&&(d=u.apply(s,c)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return zr.lex(t,r??this.defaults)}parser(t,r){return on.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer(t):t?zr.lex:zr.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(t):t?on.parse:on.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer(t):t?zr.lex:zr.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?on.parse:on.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(t,r){return n=>{if(n.message+=`
753
753
  Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+kr(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Ls=new zte;function nt(e,t){return Ls.parse(e,t)}nt.options=nt.setOptions=function(e){return Ls.setOptions(e),nt.defaults=Ls.defaults,s8(nt.defaults),nt};nt.getDefaults=E1;nt.defaults=Vs;function $te(...e){return Ls.use(...e),nt.defaults=Ls.defaults,s8(nt.defaults),nt}nt.use=$te;nt.walkTokens=function(e,t){return Ls.walkTokens(e,t)};nt.parseInline=Ls.parseInline;nt.Parser=on;nt.parser=on.parse;nt.Renderer=Fc;nt.TextRenderer=C1;nt.Lexer=zr;nt.lexer=zr.lex;nt.Tokenizer=Bc;nt.Hooks=No;nt.parse=nt;nt.options;nt.setOptions;nt.walkTokens;nt.parseInline;on.parse;zr.lex;var jte=300,Ute="300px",Hte=500;function Vte(e={}){let{immediate:t=!1,debounceDelay:r=jte,rootMargin:n=Ute,idleTimeout:i=Hte}=e,[s,a]=k.useState(!1),o=k.useRef(null),l=k.useRef(null),u=k.useRef(null),c=k.useMemo(()=>f=>{let m=Date.now();return window.setTimeout(()=>{f({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),d=k.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(f,m)=>window.requestIdleCallback(f,m):c,[c]),h=k.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?f=>window.cancelIdleCallback(f):f=>{clearTimeout(f)},[]);return k.useEffect(()=>{if(t){a(!0);return}let f=o.current;if(!f)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null);let m=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null)},b=x=>{u.current=d(_=>{_.timeRemaining()>0||_.didTimeout?(a(!0),x.disconnect()):u.current=d(()=>{a(!0),x.disconnect()},{timeout:i/2})},{timeout:i})},y=x=>{m(),l.current=window.setTimeout(()=>{var _,A;let S=x.takeRecords();(S.length===0||(A=(_=S.at(-1))==null?void 0:_.isIntersecting)!=null&&A)&&b(x)},r)},E=(x,_)=>{x.isIntersecting?y(_):m()},w=new IntersectionObserver(x=>{for(let _ of x)E(_,w)},{rootMargin:n,threshold:0});return w.observe(f),()=>{l.current&&clearTimeout(l.current),u.current&&h(u.current),w.disconnect()}},[t,r,n,i,h,d]),{shouldRender:s,containerRef:o}}var qte=320,Gte=4,p8=()=>typeof performance>"u"?Date.now():performance.now();function Iy(e){var t,r;let n=(t=e==null?void 0:e.now)!=null?t:p8,i=(r=e==null?void 0:e.maxBacklogMs)!=null?r:qte,s=0,a=0;return{now:n,beginPass(o){a=Math.min(Math.max(s,o),o+i)},mark(){return a},rewind(o){a=o},take(o,l,u){if(o<=0)return{baseDelay:0,step:Math.max(0,l)};let c=Math.max(0,l),d=c===0?0:Math.min(c,Gte),h=Math.max(a,u),f=u+i,m=h+Math.max(0,o-1)*c,b=c;if(m>f&&o>1)if(h<f){let E=f-h;b=Math.max(d,E/(o-1))}else b=d;let y=Math.max(0,Math.round(h-u));return a=h+o*b,{baseDelay:y,step:b}},commitPass(){s=a}}}var g8=/\s/,I1=/^\s+$/,Wte=new Set(["pre","svg","math","annotation"]),Zte=new Set(["img","hr"]),Hl=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",N1=e=>e.some(t=>Hl(t)&&Wte.has(t.tagName)),Yte=e=>{for(let t=e.length-1;t>=0;t--){let r=e[t];if(Hl(r)&&r.tagName==="li")return r}},Kte=(e,t,r,n)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate-marker"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(r)}ms;--sd-marker-easing:${n}`},Xte=new Set(["ul","ol","li"]),b8=e=>{for(let t of e.children)if(Hl(t)){if(t.tagName==="input")return t;if(Xte.has(t.tagName))continue;let r=b8(t);if(r)return r}},y8=(e,t,r,n)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${r}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(n)}ms`},Qte=(e,t,r,n)=>{let i=b8(e);i&&y8(i,t,r,n)},Jte=(e,t,r,n,i,s)=>{if(N1(t))return;let a=n.prevContentLength,o=i.count;i.count+=1;let l=a>0&&o<a,u=l?0:s.baseDelay+i.newIndex++*s.step;y8(e,r,l?0:r.duration,u)},ere=e=>{var t;for(let r=e.length-1;r>=0;r-=1){let n=e[r];if(Hl(n)){if((t=n.properties)!=null&&t["data-sd-animated"])break;n.properties={...n.properties,"data-sd-animated":!0}}}},v8=e=>{let t=[],r="",n=!1;for(let i of e){let s=g8.test(i);if(s!==n&&r){if(s){r+=i,n=!0;continue}t.push(r),r=""}r+=i,n=s}return r&&t.push(r),t},x8=e=>{let t=[],r="";for(let n of e)g8.test(n)?t.length>0&&!I1.test(t.at(-1))?t[t.length-1]+=n:r+=n:(r&&(t.push(r),r=""),t.push(n));return r&&(t.length>0?t[t.length-1]+=r:t.push(r)),t},Ny=/^[^\s;:'"\\/](?:[^;:'"\\/\r\n]*[^\s;:'"\\/])?$/,tre=(e,t,r,n)=>{let i=`sd-${t.animation}`,s=`${r?0:t.duration}ms`,a;return t.styleObjects?(a={"--sd-animation":i,"--sd-duration":s,"--sd-easing":t.easing},n&&(a["--sd-delay"]=`${Math.round(n)}ms`)):(a=`--sd-animation:${i};--sd-duration:${s};--sd-easing:${t.easing}`,n&&(a+=`;--sd-delay:${Math.round(n)}ms`)),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:a},children:[{type:"text",value:e}]}},Ry=(e,t)=>!(e>0&&t<e),sm=e=>Hl(e)&&Zte.has(e.tagName),rre=(e,t,r)=>{let n=0,i=0;return Ll(e,s=>s.type==="text"||sm(s),(s,a)=>{if(N1(a))return Ii;if(sm(s)){Ry(r,i)&&(n+=1),i+=1;return}let o=s.value;if(!o.trim()){i+=o.length;return}let l=t.sep==="char"?x8(o):v8(o);for(let u of l){let c=i;i+=u.length,!I1.test(u)&&Ry(r,c)&&(n+=1)}}),n},nre=(e,t,r,n,i,s)=>{var a;let o=t.at(-1);if(!(o&&"children"in o))return;if(N1(t))return Ii;let l=o,u=l.children.indexOf(e);if(u===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let d=r.sep==="char"?x8(c):v8(c),h=n.prevContentLength,f=!1,m=Yte(t),b=!!(m&&!((a=m.properties)!=null&&a["data-sd-animate-marker"])),y=!1,E=d.map(w=>{let x=i.count;if(i.count+=w.length,I1.test(w))return{type:"text",value:w};let _=h>0&&x<h,A=_?0:s.baseDelay+i.newIndex++*s.step;if(f=!0,m&&b&&!y){let S=_?0:r.duration;Kte(m,S,A,r.easing),Qte(m,r,S,A),y=!0}return tre(w,r,_,A)});return f&&ere(t),l.children.splice(u,1,...E),u+E.length},ire=0;function sre(e){return E8(e,!1)}var are=e=>E8(e,!0);function E8(e,t){var r,n,i,s,a;let o=(r=e==null?void 0:e.animation)!=null?r:"fadeIn",l=(n=e==null?void 0:e.easing)!=null?n:"ease",u={animation:o,duration:(i=e==null?void 0:e.duration)!=null?i:150,easing:l,sep:(s=e==null?void 0:e.sep)!=null?s:"word",stagger:(a=e==null?void 0:e.stagger)!=null?a:40,styleObjects:t&&Ny.test(o)&&Ny.test(l),timeline:e==null?void 0:e.timeline},c={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},d=ire++,h=()=>f=>{var m;let b={count:0,newIndex:0};c.prevContentLength=c.committedCharCount;let y=u.timeline,E=(m=y==null?void 0:y.now())!=null?m:p8();y&&(c.pendingMark===null?c.pendingMark=y.mark():y.rewind(c.pendingMark));let w=y?y.take(rre(f,u,c.prevContentLength),u.stagger,E):{baseDelay:0,step:u.stagger};Ll(f,x=>x.type==="text"||sm(x),(x,_)=>{if(x.type==="text")return nre(x,_,u,c,b,w);Jte(x,_,u,c,b,w)}),c.lastRenderCharCount=b.count,c.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(f){c.committedCharCount=f,c.prevContentLength=f},getLastRenderCharCount(){return c.lastRenderCharCount},commit(){c.committedCharCount=c.lastRenderCharCount,c.pendingMark=null}}}sre();var _8=k.createContext(!1),T8=()=>k.useContext(_8),H0=(...e)=>up(Qc(e)),ore=(e,t)=>{if(!e||!t)return t;let r=`${e}:`;return t.split(/\s+/).filter(Boolean).map(n=>n.startsWith(r)?n:`${e}:${n}`).join(" ")},lre=e=>e?(...t)=>ore(e,up(Qc(t))):H0,_a=(e,t,r)=>{let n=typeof t=="string"&&r.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([n+t],{type:r}):t,s=URL.createObjectURL(i),a=document.createElement("a");a.href=s,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)},am=k.createContext(H0),We=()=>k.useContext(am),ure=8,w8=e=>{if(!(e===void 0||e===0||e===Number.POSITIVE_INFINITY)){if(typeof e=="number")return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(!(e==="0"||e==="none"||e==="Infinity"))return e}},k8=(e,t,r)=>{let n=k.useRef(null),i=k.useRef(!0),s=k.useRef(!1),a=k.useRef(null);return k.useEffect(()=>{let o=n.current;if(!(o&&t))return;let l=()=>{let u=o.scrollHeight-o.scrollTop-o.clientHeight<ure;i.current=u};return o.addEventListener("scroll",l,{passive:!0}),()=>o.removeEventListener("scroll",l)},[t]),k.useEffect(()=>{e&&!s.current&&(i.current=!0),e||(i.current=!0),s.current=e},[e]),k.useEffect(()=>()=>{a.current!==null&&cancelAnimationFrame(a.current)},[]),k.useEffect(()=>{let o=n.current;!(o&&t&&e&&i.current)||a.current!==null||(a.current=requestAnimationFrame(()=>{a.current=null,i.current&&o.scrollTo({top:o.scrollHeight,behavior:"instant"})}))},[e,t,r]),n},cre=H0("block"),dre=H0("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),hre=e=>{let t={};for(let r of e.split(";")){let n=r.indexOf(":");if(n>0){let i=r.slice(0,n).trim(),s=r.slice(n+1).trim();i&&s&&(t[i]=s)}}return t},fre=k.memo(({children:e,result:t,language:r,className:n,maxHeight:i,startLine:s,lineNumbers:a=!0,...o})=>{let l=We(),{isAnimating:u}=k.useContext(Zt),c=w8(i),d=k8(u,!!c,t),h=k.useMemo(()=>l(dre),[l]),f=k.useMemo(()=>l(cre),[l]),m=k.useMemo(()=>{let b={};return t.bg&&(b["--sdm-bg"]=t.bg),t.fg&&(b["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(b,hre(t.rootStyle)),b},[t.bg,t.fg,t.rootStyle]);return v.jsx("div",{className:l(n,c?"overflow-y-auto":null,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":r,"data-streamdown":"code-block-body",ref:d,style:c?{maxHeight:c}:void 0,...o,children:v.jsx("pre",{className:l(n,"bg-[var(--sdm-bg,inherit)]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]"),style:m,children:v.jsx("code",{className:a?l("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((b,y)=>v.jsx("span",{className:a?h:f,children:b.length===0||b.length===1&&b[0].content===""?`
754
754
  `:b.map((E,w)=>{let x={},_=!!E.bgColor;if(E.color&&(x["--sdm-c"]=E.color),E.bgColor&&(x["--sdm-tbg"]=E.bgColor),E.htmlStyle)for(let[A,S]of Object.entries(E.htmlStyle))A==="color"?x["--sdm-c"]=S:A==="background-color"?(x["--sdm-tbg"]=S,_=!0):x[A]=S;return v.jsx("span",{className:l("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",_&&"bg-[var(--sdm-tbg)]",_&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:x,...E.htmlAttrs,children:E.content},w)})},y))})})})}),mre=({className:e,language:t,style:r,isIncomplete:n,...i})=>{let s=We();return v.jsx("div",{className:s("relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":n||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...i})},S8=k.createContext({code:""}),A8=()=>k.useContext(S8),pre=({language:e})=>{let t=We();return v.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:v.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},gre=e=>{let t=e.length;for(;t>0&&e[t-1]===`
755
- `;)t--;return e.slice(0,t)},bre=k.lazy(()=>O(()=>import("./highlighted-body-KQOG7T2V-ClwcaYX1.js"),__vite__mapDeps([125,126,127,128,129])).then(e=>({default:e.HighlightedCodeBlockBody}))),yre=({code:e,language:t,className:r,children:n,isIncomplete:i=!1,startLine:s,lineNumbers:a,...o})=>{let l=We(),{codeBlockMaxHeight:u}=k.useContext(Zt),c=k.useMemo(()=>gre(e),[e]),d=k.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:c.split(`
756
- `).map(h=>[{content:h,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return v.jsx(S8.Provider,{value:{code:e},children:v.jsxs(mre,{dir:"ltr",isIncomplete:i,language:t,children:[v.jsx(pre,{language:t}),n?v.jsx("div",{className:l("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:v.jsx("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:n})}):null,v.jsx(k.Suspense,{fallback:v.jsx(fre,{className:r,language:t,lineNumbers:a,maxHeight:u,result:d,startLine:s,...o}),children:v.jsx(bre,{className:r,code:c,isIncomplete:i,language:t,lineNumbers:a,maxHeight:u,raw:d,startLine:s,...o})})]})})},vre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),xre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Ere=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),_re=e=>v.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[v.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Tre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),wre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),kre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Sre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Are=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Cre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Ro={CheckIcon:vre,CopyIcon:xre,DownloadIcon:Ere,ExternalLinkIcon:Sre,Loader2Icon:_re,Maximize2Icon:Tre,RotateCcwIcon:wre,XIcon:kre,ZoomInIcon:Are,ZoomOutIcon:Cre},C8=k.createContext(Ro),Ire=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(i=>e[i]===t[i])},Py=({icons:e,children:t})=>{let r=k.useRef(e),n=k.useRef(e?{...Ro,...e}:Ro);Ire(r.current,e)||(r.current=e,n.current=e?{...Ro,...e}:Ro);let i=n.current;return v.jsx(C8.Provider,{value:i,children:t})},pn=()=>k.useContext(C8),I8={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},om=k.createContext(I8),zn=()=>k.useContext(om),lm=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:i,code:s,...a})=>{let o=We(),[l,u]=k.useState(!1),c=k.useRef(0),{code:d}=A8(),{isAnimating:h}=k.useContext(Zt),f=zn(),m=s??d,b=async()=>{var w;if(typeof window>"u"||!((w=navigator==null?void 0:navigator.clipboard)!=null&&w.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(m),u(!0),e==null||e(),c.current=window.setTimeout(()=>u(!1),r))}catch(x){t==null||t(x)}};k.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let y=pn(),E=l?y.CheckIcon:y.CopyIcon;return v.jsxs(v.Fragment,{children:[v.jsx("button",{"aria-label":f.copyCode,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:h,onClick:b,title:f.copyCode,type:"button",...a,children:n??v.jsx(E,{"aria-hidden":"true",size:14})}),l&&v.jsx("output",{"aria-live":"polite",className:"sr-only",children:f.copied})]})},R1=(e,t,r)=>{if(typeof e=="boolean")return r;let n=e[t];if(typeof n!="object")return r;let i=n.download;return typeof i!="object"?r:i.filename||r},Oy=(e,t)=>{if(typeof e=="boolean")return{};let r=e[t];if(typeof r!="object")return{};let n=r.copy;return typeof n!="object"||n===null?{}:{onCopy:n.onCopy,onError:n.onError}},Ly={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Nre=({onDownload:e,onError:t,language:r,children:n,className:i,code:s,...a})=>{let o=We(),{code:l}=A8(),{isAnimating:u,controls:c}=k.useContext(Zt),d=zn(),h=pn(),f=s??l,m=r&&r in Ly?Ly[r]:"txt",b=`${R1(c,"code","file")}.${m}`,y="text/plain",E=()=>{try{_a(b,f,y),e==null||e()}catch(w){t==null||t(w)}};return v.jsx("button",{"aria-label":d.downloadFile,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:u,onClick:E,title:d.downloadFile,type:"button",...a,children:n??v.jsx(h.DownloadIcon,{size:14})})},Dy=()=>{let{Loader2Icon:e}=pn(),t=We();return v.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[v.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),v.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:v.jsx(e,{className:t("size-4 animate-spin")})})]})},Rre=/\.[^/.]+$/,Pre=({node:e,className:t,src:r,alt:n,onLoad:i,onError:s,showControls:a=!0,showDownloadControl:o=!0,...l})=>{let{DownloadIcon:u}=pn(),c=We(),d=k.useRef(null),[h,f]=k.useState(!1),[m,b]=k.useState(!1),y=zn(),E=l.width!=null||l.height!=null,w=(h||E)&&!m&&a&&o,x=m&&!E;k.useEffect(()=>{let I=d.current;if(I!=null&&I.complete){let N=I.naturalWidth>0;f(N),b(!N)}},[]);let _=k.useCallback(I=>{f(!0),b(!1),i==null||i(I)},[i]),A=k.useCallback(I=>{f(!1),b(!0),s==null||s(I)},[s]),S=async()=>{if(r)try{let I=await(await fetch(r)).blob(),N=new URL(r,window.location.origin).pathname.split("/").pop()||"",U=N.split(".").pop(),z=N.includes(".")&&U!==void 0&&U.length<=4,Z="";if(z)Z=N;else{let V=I.type,ae="png";V.includes("jpeg")||V.includes("jpg")?ae="jpg":V.includes("png")?ae="png":V.includes("svg")?ae="svg":V.includes("gif")?ae="gif":V.includes("webp")&&(ae="webp"),Z=`${(n||N||"image").replace(Rre,"")}.${ae}`}_a(Z,I,I.type)}catch{window.open(r,"_blank")}};return r?r===dl?v.jsx("div",{className:c("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:v.jsx("div",{className:c("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):v.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[v.jsx("img",{alt:n,className:c("max-w-full rounded-lg",x&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:_,ref:d,src:r,...l}),x&&v.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:y.imageNotAvailable}),a&&v.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),w&&v.jsx("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:S,title:y.downloadImage,type:"button",children:v.jsx(u,{size:14})})]}):null},P1=e=>{let t=typeof e=="function"?e():e;return t??document.body},qo=0,O1=()=>{qo+=1,qo===1&&(document.body.style.overflow="hidden")},L1=()=>{qo=Math.max(0,qo-1),qo===0&&(document.body.style.overflow="")},Ore=({url:e,isOpen:t,onClose:r,onConfirm:n})=>{let{CheckIcon:i,CopyIcon:s,ExternalLinkIcon:a,XIcon:o}=pn(),l=We(),[u,c]=k.useState(!1),d=zn(),{portal:h}=k.useContext(Zt),f=k.useCallback(async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[e]),m=k.useCallback(()=>{n(),r()},[n,r]);if(k.useEffect(()=>{if(t){O1();let y=E=>{E.key==="Escape"&&r()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),L1()}}},[t,r]),!t||typeof document>"u")return null;let b=v.jsx("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:r,onKeyDown:y=>{y.key==="Escape"&&r()},role:"button",tabIndex:0,children:v.jsxs("div",{className:l("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:[v.jsx("button",{className:l("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:r,title:d.close,type:"button",children:v.jsx(o,{size:16})}),v.jsxs("div",{className:l("flex flex-col gap-2"),children:[v.jsxs("div",{className:l("flex items-center gap-2 font-semibold text-lg"),children:[v.jsx(a,{size:20}),v.jsx("span",{children:d.openExternalLink})]}),v.jsx("p",{className:l("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),v.jsx("div",{className:l("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),v.jsxs("div",{className:l("flex gap-2"),children:[v.jsx("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:f,type:"button",children:u?v.jsxs(v.Fragment,{children:[v.jsx(i,{size:14}),v.jsx("span",{children:d.copied})]}):v.jsxs(v.Fragment,{children:[v.jsx(s,{size:14}),v.jsx("span",{children:d.copyLink})]})}),v.jsxs("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:m,type:"button",children:[v.jsx(a,{size:14}),v.jsx("span",{children:d.openLink})]})]})]})});return $a.createPortal(b,P1(h))},um=k.createContext(null),D1=()=>k.useContext(um),x0e=()=>{var e;let t=D1();return(e=t==null?void 0:t.code)!=null?e:null},M1=()=>{var e;let t=D1();return(e=t==null?void 0:t.mermaid)!=null?e:null},Lre=e=>{var t;let r=D1();return r!=null&&r.renderers&&e&&(t=r.renderers.find(n=>Array.isArray(n.language)?n.language.includes(e):n.language===e))!=null?t:null},N8=/<svg\b[^>]*>/i,Dre=/\bviewBox=(['"])(.*?)\1/i,Mre=/[\s,]+/,Bre=/\swidth=(['"]).*?\1/gi,Fre=/\sheight=(['"]).*?\1/gi,My=/\sstyle=(['"])(.*?)\1/i,zre=/^width\s*:/i,$re=/^height\s*:/i,jre=/^max-width\s*:/i,By=/^<svg/i,R8=e=>{let t=e.match(N8);if(!t)return null;let r=t[0].match(Dre),n=r==null?void 0:r[2];if(!n)return null;let i=n.trim().split(Mre).map(o=>Number.parseFloat(o));if(i.length<4||i.slice(0,4).some(Number.isNaN))return null;let s=i[2],a=i[3];return s>0&&a>0?{height:a,width:s}:null},Ure=e=>{let t=e.match(N8);if(!t)return e;try{let r=t[0],n=R8(e);if(!n)return e;let{width:i,height:s}=n,a=r.replace(Bre,"").replace(Fre,""),o=a.match(My),l=`width:${i}px;height:${s}px;max-width:none;`;if(o){let u=o[1],c=o[2].split(";").map(h=>h.trim()).filter(Boolean).filter(h=>!(zre.test(h)||$re.test(h)||jre.test(h))).join(";"),d=`${l}${c?`${c};`:""}`;a=a.replace(My,` style=${u}${d}${u}`)}else a=a.replace(By,`<svg style="${l}"`);return a=a.replace(By,`<svg width="${i}" height="${s}"`),e.replace(r,a)}catch{return e}},Hre=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},Vre=(e,t)=>{var r;let n=(r=void 0)!=null?r:5;return new Promise((i,s)=>{let a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let l=document.createElement("canvas"),u=o.width*n,c=o.height*n;l.width=u,l.height=c;let d=l.getContext("2d");if(!d){s(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(o,0,0,u,c),l.toBlob(h=>{if(!h){s(new Error("Failed to create PNG blob"));return}i(h)},"image/png")},o.onerror=()=>s(new Error("Failed to load SVG image")),o.src=a})},P8=({chart:e,children:t,className:r,onDownload:n,config:i,onError:s})=>{let a=We(),[o,l]=k.useState(!1),u=k.useRef(null),{isAnimating:c,controls:d}=k.useContext(Zt),h=pn(),f=M1(),m=zn(),b=R1(d,"mermaid","diagram"),y=async E=>{try{if(E==="mmd"){let I=`${b}.mmd`;_a(I,e,"text/plain"),l(!1),n==null||n(E);return}if(!f){s==null||s(new Error("Mermaid plugin not available"));return}let w=f.getMermaid(i),x=e.split("").reduce((I,N)=>(I<<5)-I+N.charCodeAt(0)|0,0),_=`mermaid-${Math.abs(x)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await w.render(_,e);if(!A){s==null||s(new Error("SVG not found. Please wait for the diagram to render."));return}let S=Hre(A);if(E==="svg"){let I=`${b}.svg`;_a(I,S,"image/svg+xml"),l(!1),n==null||n(E);return}if(E==="png"){let I=await Vre(S);_a(`${b}.png`,I,"image/png"),n==null||n(E),l(!1);return}}catch(w){s==null||s(w)}};return k.useEffect(()=>{let E=w=>{let x=w.composedPath();u.current&&!x.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[]),v.jsxs("div",{className:a("relative"),ref:u,children:[v.jsx("button",{"aria-label":m.downloadDiagram,className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:c,onClick:()=>l(!o),title:m.downloadDiagram,type:"button",children:t??v.jsx(h.DownloadIcon,{"aria-hidden":"true",size:14})}),o?v.jsxs("div",{className:a("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{"aria-label":m.downloadDiagramAsSvg,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("svg"),title:m.downloadDiagramAsSvg,type:"button",children:m.mermaidFormatSvg}),v.jsx("button",{"aria-label":m.downloadDiagramAsPng,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("png"),title:m.downloadDiagramAsPng,type:"button",children:m.mermaidFormatPng}),v.jsx("button",{"aria-label":m.downloadDiagramAsMmd,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("mmd"),title:m.downloadDiagramAsMmd,type:"button",children:m.mermaidFormatMmd})]}):null]})},qre=({chart:e,config:t,onFullscreen:r,onExit:n,className:i,...s})=>{let{Maximize2Icon:a,XIcon:o}=pn(),l=We(),[u,c]=k.useState(!1),{isAnimating:d,controls:h,portal:f}=k.useContext(Zt),m=zn(),b=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.panZoom!==!1})(),y=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.download!==!1})(),E=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.copy!==!1})(),w=()=>{c(!u)};return k.useEffect(()=>{if(u){O1();let x=_=>{_.key==="Escape"&&c(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),L1()}}},[u]),k.useEffect(()=>{u?r==null||r():n&&n()},[u,r,n]),v.jsxs(v.Fragment,{children:[v.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:d,onClick:w,title:m.viewFullscreen,type:"button",...s,"aria-label":m.viewFullscreen,children:v.jsx(a,{"aria-hidden":"true",size:14})}),u?$a.createPortal(v.jsxs("div",{"aria-label":m.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:w,onKeyDown:x=>{x.key==="Escape"&&w()},role:"dialog",children:[v.jsxs("div",{className:l("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[y?v.jsx(P8,{chart:e,config:t}):null,E?v.jsx(lm,{code:e}):null,v.jsx("button",{"aria-label":m.exitFullscreen,className:l("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:m.exitFullscreen,type:"button",children:v.jsx(o,{"aria-hidden":"true",size:20})})]}),v.jsx("div",{className:l("flex size-full items-center justify-center p-4"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:v.jsx(vw,{chart:e,className:l("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:b})})]}),P1(f)):null]})};function cm(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let r=e;return r.tagName==="BR"?`
755
+ `;)t--;return e.slice(0,t)},bre=k.lazy(()=>O(()=>import("./highlighted-body-KQOG7T2V-D_9pxxPW.js"),__vite__mapDeps([125,126,127,128,129])).then(e=>({default:e.HighlightedCodeBlockBody}))),yre=({code:e,language:t,className:r,children:n,isIncomplete:i=!1,startLine:s,lineNumbers:a,...o})=>{let l=We(),{codeBlockMaxHeight:u}=k.useContext(Zt),c=k.useMemo(()=>gre(e),[e]),d=k.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:c.split(`
756
+ `).map(h=>[{content:h,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[c]);return v.jsx(S8.Provider,{value:{code:e},children:v.jsxs(mre,{dir:"ltr",isIncomplete:i,language:t,children:[v.jsx(pre,{language:t}),n?v.jsx("div",{className:l("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:v.jsx("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:n})}):null,v.jsx(k.Suspense,{fallback:v.jsx(fre,{className:r,language:t,lineNumbers:a,maxHeight:u,result:d,startLine:s,...o}),children:v.jsx(bre,{className:r,code:c,isIncomplete:i,language:t,lineNumbers:a,maxHeight:u,raw:d,startLine:s,...o})})]})})},vre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),xre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Ere=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),_re=e=>v.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[v.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Tre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),wre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),kre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Sre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Are=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Cre=e=>v.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:v.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Ro={CheckIcon:vre,CopyIcon:xre,DownloadIcon:Ere,ExternalLinkIcon:Sre,Loader2Icon:_re,Maximize2Icon:Tre,RotateCcwIcon:wre,XIcon:kre,ZoomInIcon:Are,ZoomOutIcon:Cre},C8=k.createContext(Ro),Ire=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(i=>e[i]===t[i])},Py=({icons:e,children:t})=>{let r=k.useRef(e),n=k.useRef(e?{...Ro,...e}:Ro);Ire(r.current,e)||(r.current=e,n.current=e?{...Ro,...e}:Ro);let i=n.current;return v.jsx(C8.Provider,{value:i,children:t})},pn=()=>k.useContext(C8),I8={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},om=k.createContext(I8),zn=()=>k.useContext(om),lm=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:i,code:s,...a})=>{let o=We(),[l,u]=k.useState(!1),c=k.useRef(0),{code:d}=A8(),{isAnimating:h}=k.useContext(Zt),f=zn(),m=s??d,b=async()=>{var w;if(typeof window>"u"||!((w=navigator==null?void 0:navigator.clipboard)!=null&&w.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{l||(await navigator.clipboard.writeText(m),u(!0),e==null||e(),c.current=window.setTimeout(()=>u(!1),r))}catch(x){t==null||t(x)}};k.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let y=pn(),E=l?y.CheckIcon:y.CopyIcon;return v.jsxs(v.Fragment,{children:[v.jsx("button",{"aria-label":f.copyCode,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:h,onClick:b,title:f.copyCode,type:"button",...a,children:n??v.jsx(E,{"aria-hidden":"true",size:14})}),l&&v.jsx("output",{"aria-live":"polite",className:"sr-only",children:f.copied})]})},R1=(e,t,r)=>{if(typeof e=="boolean")return r;let n=e[t];if(typeof n!="object")return r;let i=n.download;return typeof i!="object"?r:i.filename||r},Oy=(e,t)=>{if(typeof e=="boolean")return{};let r=e[t];if(typeof r!="object")return{};let n=r.copy;return typeof n!="object"||n===null?{}:{onCopy:n.onCopy,onError:n.onError}},Ly={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Nre=({onDownload:e,onError:t,language:r,children:n,className:i,code:s,...a})=>{let o=We(),{code:l}=A8(),{isAnimating:u,controls:c}=k.useContext(Zt),d=zn(),h=pn(),f=s??l,m=r&&r in Ly?Ly[r]:"txt",b=`${R1(c,"code","file")}.${m}`,y="text/plain",E=()=>{try{_a(b,f,y),e==null||e()}catch(w){t==null||t(w)}};return v.jsx("button",{"aria-label":d.downloadFile,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:u,onClick:E,title:d.downloadFile,type:"button",...a,children:n??v.jsx(h.DownloadIcon,{size:14})})},Dy=()=>{let{Loader2Icon:e}=pn(),t=We();return v.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[v.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),v.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:v.jsx(e,{className:t("size-4 animate-spin")})})]})},Rre=/\.[^/.]+$/,Pre=({node:e,className:t,src:r,alt:n,onLoad:i,onError:s,showControls:a=!0,showDownloadControl:o=!0,...l})=>{let{DownloadIcon:u}=pn(),c=We(),d=k.useRef(null),[h,f]=k.useState(!1),[m,b]=k.useState(!1),y=zn(),E=l.width!=null||l.height!=null,w=(h||E)&&!m&&a&&o,x=m&&!E;k.useEffect(()=>{let I=d.current;if(I!=null&&I.complete){let N=I.naturalWidth>0;f(N),b(!N)}},[]);let _=k.useCallback(I=>{f(!0),b(!1),i==null||i(I)},[i]),A=k.useCallback(I=>{f(!1),b(!0),s==null||s(I)},[s]),S=async()=>{if(r)try{let I=await(await fetch(r)).blob(),N=new URL(r,window.location.origin).pathname.split("/").pop()||"",U=N.split(".").pop(),z=N.includes(".")&&U!==void 0&&U.length<=4,Z="";if(z)Z=N;else{let V=I.type,ae="png";V.includes("jpeg")||V.includes("jpg")?ae="jpg":V.includes("png")?ae="png":V.includes("svg")?ae="svg":V.includes("gif")?ae="gif":V.includes("webp")&&(ae="webp"),Z=`${(n||N||"image").replace(Rre,"")}.${ae}`}_a(Z,I,I.type)}catch{window.open(r,"_blank")}};return r?r===dl?v.jsx("div",{className:c("group relative my-4 inline-block"),"data-incomplete":"true","data-streamdown":"image-wrapper",children:v.jsx("div",{className:c("h-24 w-48 animate-pulse rounded-lg bg-muted"),"data-streamdown":"image-placeholder"})}):v.jsxs("div",{className:c("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[v.jsx("img",{alt:n,className:c("max-w-full rounded-lg",x&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:_,ref:d,src:r,...l}),x&&v.jsx("span",{className:c("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:y.imageNotAvailable}),a&&v.jsx("div",{className:c("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),w&&v.jsx("button",{className:c("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:S,title:y.downloadImage,type:"button",children:v.jsx(u,{size:14})})]}):null},P1=e=>{let t=typeof e=="function"?e():e;return t??document.body},qo=0,O1=()=>{qo+=1,qo===1&&(document.body.style.overflow="hidden")},L1=()=>{qo=Math.max(0,qo-1),qo===0&&(document.body.style.overflow="")},Ore=({url:e,isOpen:t,onClose:r,onConfirm:n})=>{let{CheckIcon:i,CopyIcon:s,ExternalLinkIcon:a,XIcon:o}=pn(),l=We(),[u,c]=k.useState(!1),d=zn(),{portal:h}=k.useContext(Zt),f=k.useCallback(async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[e]),m=k.useCallback(()=>{n(),r()},[n,r]);if(k.useEffect(()=>{if(t){O1();let y=E=>{E.key==="Escape"&&r()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),L1()}}},[t,r]),!t||typeof document>"u")return null;let b=v.jsx("div",{className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:r,onKeyDown:y=>{y.key==="Escape"&&r()},role:"button",tabIndex:0,children:v.jsxs("div",{className:l("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),role:"presentation",children:[v.jsx("button",{className:l("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:r,title:d.close,type:"button",children:v.jsx(o,{size:16})}),v.jsxs("div",{className:l("flex flex-col gap-2"),children:[v.jsxs("div",{className:l("flex items-center gap-2 font-semibold text-lg"),children:[v.jsx(a,{size:20}),v.jsx("span",{children:d.openExternalLink})]}),v.jsx("p",{className:l("text-muted-foreground text-sm"),children:d.externalLinkWarning})]}),v.jsx("div",{className:l("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),v.jsxs("div",{className:l("flex gap-2"),children:[v.jsx("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:f,type:"button",children:u?v.jsxs(v.Fragment,{children:[v.jsx(i,{size:14}),v.jsx("span",{children:d.copied})]}):v.jsxs(v.Fragment,{children:[v.jsx(s,{size:14}),v.jsx("span",{children:d.copyLink})]})}),v.jsxs("button",{className:l("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:m,type:"button",children:[v.jsx(a,{size:14}),v.jsx("span",{children:d.openLink})]})]})]})});return $a.createPortal(b,P1(h))},um=k.createContext(null),D1=()=>k.useContext(um),E0e=()=>{var e;let t=D1();return(e=t==null?void 0:t.code)!=null?e:null},M1=()=>{var e;let t=D1();return(e=t==null?void 0:t.mermaid)!=null?e:null},Lre=e=>{var t;let r=D1();return r!=null&&r.renderers&&e&&(t=r.renderers.find(n=>Array.isArray(n.language)?n.language.includes(e):n.language===e))!=null?t:null},N8=/<svg\b[^>]*>/i,Dre=/\bviewBox=(['"])(.*?)\1/i,Mre=/[\s,]+/,Bre=/\swidth=(['"]).*?\1/gi,Fre=/\sheight=(['"]).*?\1/gi,My=/\sstyle=(['"])(.*?)\1/i,zre=/^width\s*:/i,$re=/^height\s*:/i,jre=/^max-width\s*:/i,By=/^<svg/i,R8=e=>{let t=e.match(N8);if(!t)return null;let r=t[0].match(Dre),n=r==null?void 0:r[2];if(!n)return null;let i=n.trim().split(Mre).map(o=>Number.parseFloat(o));if(i.length<4||i.slice(0,4).some(Number.isNaN))return null;let s=i[2],a=i[3];return s>0&&a>0?{height:a,width:s}:null},Ure=e=>{let t=e.match(N8);if(!t)return e;try{let r=t[0],n=R8(e);if(!n)return e;let{width:i,height:s}=n,a=r.replace(Bre,"").replace(Fre,""),o=a.match(My),l=`width:${i}px;height:${s}px;max-width:none;`;if(o){let u=o[1],c=o[2].split(";").map(h=>h.trim()).filter(Boolean).filter(h=>!(zre.test(h)||$re.test(h)||jre.test(h))).join(";"),d=`${l}${c?`${c};`:""}`;a=a.replace(My,` style=${u}${d}${u}`)}else a=a.replace(By,`<svg style="${l}"`);return a=a.replace(By,`<svg width="${i}" height="${s}"`),e.replace(r,a)}catch{return e}},Hre=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},Vre=(e,t)=>{var r;let n=(r=void 0)!=null?r:5;return new Promise((i,s)=>{let a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let l=document.createElement("canvas"),u=o.width*n,c=o.height*n;l.width=u,l.height=c;let d=l.getContext("2d");if(!d){s(new Error("Failed to create 2D canvas context for PNG export"));return}d.drawImage(o,0,0,u,c),l.toBlob(h=>{if(!h){s(new Error("Failed to create PNG blob"));return}i(h)},"image/png")},o.onerror=()=>s(new Error("Failed to load SVG image")),o.src=a})},P8=({chart:e,children:t,className:r,onDownload:n,config:i,onError:s})=>{let a=We(),[o,l]=k.useState(!1),u=k.useRef(null),{isAnimating:c,controls:d}=k.useContext(Zt),h=pn(),f=M1(),m=zn(),b=R1(d,"mermaid","diagram"),y=async E=>{try{if(E==="mmd"){let I=`${b}.mmd`;_a(I,e,"text/plain"),l(!1),n==null||n(E);return}if(!f){s==null||s(new Error("Mermaid plugin not available"));return}let w=f.getMermaid(i),x=e.split("").reduce((I,N)=>(I<<5)-I+N.charCodeAt(0)|0,0),_=`mermaid-${Math.abs(x)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await w.render(_,e);if(!A){s==null||s(new Error("SVG not found. Please wait for the diagram to render."));return}let S=Hre(A);if(E==="svg"){let I=`${b}.svg`;_a(I,S,"image/svg+xml"),l(!1),n==null||n(E);return}if(E==="png"){let I=await Vre(S);_a(`${b}.png`,I,"image/png"),n==null||n(E),l(!1);return}}catch(w){s==null||s(w)}};return k.useEffect(()=>{let E=w=>{let x=w.composedPath();u.current&&!x.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[]),v.jsxs("div",{className:a("relative"),ref:u,children:[v.jsx("button",{"aria-label":m.downloadDiagram,className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",r),disabled:c,onClick:()=>l(!o),title:m.downloadDiagram,type:"button",children:t??v.jsx(h.DownloadIcon,{"aria-hidden":"true",size:14})}),o?v.jsxs("div",{className:a("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{"aria-label":m.downloadDiagramAsSvg,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("svg"),title:m.downloadDiagramAsSvg,type:"button",children:m.mermaidFormatSvg}),v.jsx("button",{"aria-label":m.downloadDiagramAsPng,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("png"),title:m.downloadDiagramAsPng,type:"button",children:m.mermaidFormatPng}),v.jsx("button",{"aria-label":m.downloadDiagramAsMmd,className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("mmd"),title:m.downloadDiagramAsMmd,type:"button",children:m.mermaidFormatMmd})]}):null]})},qre=({chart:e,config:t,onFullscreen:r,onExit:n,className:i,...s})=>{let{Maximize2Icon:a,XIcon:o}=pn(),l=We(),[u,c]=k.useState(!1),{isAnimating:d,controls:h,portal:f}=k.useContext(Zt),m=zn(),b=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.panZoom!==!1})(),y=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.download!==!1})(),E=(()=>{if(typeof h=="boolean")return h;let x=h.mermaid;return x===!1?!1:x===!0||x===void 0?!0:x.copy!==!1})(),w=()=>{c(!u)};return k.useEffect(()=>{if(u){O1();let x=_=>{_.key==="Escape"&&c(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),L1()}}},[u]),k.useEffect(()=>{u?r==null||r():n&&n()},[u,r,n]),v.jsxs(v.Fragment,{children:[v.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:d,onClick:w,title:m.viewFullscreen,type:"button",...s,"aria-label":m.viewFullscreen,children:v.jsx(a,{"aria-hidden":"true",size:14})}),u?$a.createPortal(v.jsxs("div",{"aria-label":m.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:w,onKeyDown:x=>{x.key==="Escape"&&w()},role:"dialog",children:[v.jsxs("div",{className:l("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[y?v.jsx(P8,{chart:e,config:t}):null,E?v.jsx(lm,{code:e}):null,v.jsx("button",{"aria-label":m.exitFullscreen,className:l("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:m.exitFullscreen,type:"button",children:v.jsx(o,{"aria-hidden":"true",size:20})})]}),v.jsx("div",{className:l("flex size-full items-center justify-center p-4"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:v.jsx(vw,{chart:e,className:l("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:b})})]}),P1(f)):null]})};function cm(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let r=e;return r.tagName==="BR"?`
757
757
  `:Array.from(r.childNodes).map(cm).join("")}var O8=e=>{let t=[],r=[],n=e.querySelectorAll("thead th");for(let s of n)t.push(cm(s).trim());let i=e.querySelectorAll("tbody tr");for(let s of i){let a=[],o=s.querySelectorAll("td");for(let l of o)a.push(cm(l).trim());r.push(a)}return{headers:t,rows:r}},L8=e=>{var t;if(typeof e!="object")return",";let r=e.table;return typeof r!="object"?",":(t=r.csvSeparator)!=null?t:","},D8=(e,t=",")=>{let r;t==="auto"?Intl.NumberFormat().format(1.1).includes(",")?r=";":r=",":r=t;let{headers:n,rows:i}=e,s=u=>{let c=!1;for(let d of u)if(d===r||d==='"'||d===`
758
758
  `||d==="\r"){c=!0;break}return c?`"${u.replace(/"/g,'""')}"`:u},a=n.length>0?i.length+1:i.length,o=new Array(a),l=0;n.length>0&&(o[l]=n.map(s).join(r),l+=1);for(let u of i)o[l]=u.map(s).join(r),l+=1;return o.join(`
759
759
  `)},Gre=e=>{let{headers:t,rows:r}=e,n=o=>{let l=!1;for(let c of o)if(c===" "||c===`
@@ -762,7 +762,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
762
762
  `)},dh=e=>{let t=!1;for(let n of e)if(n==="\\"||n==="|"||n===`
763
763
  `||n==="&"||n==="<"||n===">"){t=!0;break}if(!t)return e;let r=[];for(let n of e)n==="\\"?r.push("\\\\"):n==="|"?r.push("\\|"):n===`
764
764
  `?r.push("<br>"):n==="&"?r.push("&amp;"):n==="<"?r.push("&lt;"):n===">"?r.push("&gt;"):r.push(n);return r.join("")},M8=e=>{let{headers:t,rows:r}=e;if(t.length===0)return"";let n=new Array(r.length+2),i=0,s=t.map(o=>dh(o));n[i]=`| ${s.join(" | ")} |`,i+=1;let a=new Array(t.length);for(let o=0;o<t.length;o+=1)a[o]="---";n[i]=`| ${a.join(" | ")} |`,i+=1;for(let o of r)if(o.length<t.length){let l=new Array(t.length);for(let u=0;u<t.length;u+=1)l[u]=u<o.length?dh(o[u]):"";n[i]=`| ${l.join(" | ")} |`,i+=1}else{let l=o.map(u=>dh(u));n[i]=`| ${l.join(" | ")} |`,i+=1}return n.join(`
765
- `)},B8=({children:e,className:t,onCopy:r,onError:n,timeout:i=2e3})=>{let s=We(),[a,o]=k.useState(!1),[l,u]=k.useState(!1),c=k.useRef(null),d=k.useRef(0),{isAnimating:h,controls:f}=k.useContext(Zt),m=zn(),b=L8(f),y=async x=>{var _,A;if(typeof window>"u"||!((_=navigator==null?void 0:navigator.clipboard)!=null&&_.write)){n==null||n(new Error("Clipboard API not available"));return}try{let S=(A=c.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),I=S==null?void 0:S.querySelector("table");if(!I){n==null||n(new Error("Table not found"));return}let N=O8(I),U="";x==="csv"?U=D8(N,b):x==="tsv"?U=Gre(N):U=M8(N);let z=new ClipboardItem({"text/plain":new Blob([U],{type:"text/plain"}),"text/html":new Blob([I.outerHTML],{type:"text/html"})});await navigator.clipboard.write([z]),u(!0),o(!1),r==null||r(x),d.current=window.setTimeout(()=>u(!1),i)}catch(S){n==null||n(S)}};k.useEffect(()=>{let x=_=>{let A=_.composedPath();c.current&&!A.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x),window.clearTimeout(d.current)}},[]);let E=pn(),w=l?E.CheckIcon:E.CopyIcon;return v.jsxs("div",{className:s("relative"),ref:c,children:[v.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>o(!a),title:m.copyTable,type:"button",children:e??v.jsx(w,{height:14,width:14})}),a?v.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("md"),title:m.copyTableAsMarkdown,type:"button",children:m.tableFormatMarkdown}),v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("csv"),title:m.copyTableAsCsv,type:"button",children:m.tableFormatCsv}),v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("tsv"),title:m.copyTableAsTsv,type:"button",children:m.tableFormatTsv})]}):null]})},F8=({children:e,className:t,onDownload:r,onError:n})=>{let i=We(),[s,a]=k.useState(!1),o=k.useRef(null),{isAnimating:l,controls:u}=k.useContext(Zt),c=zn(),d=pn(),h=L8(u),f=m=>{var b;try{let y=(b=o.current)==null?void 0:b.closest('[data-streamdown="table-wrapper"]'),E=y==null?void 0:y.querySelector("table");if(!E){n==null||n(new Error("Table not found"));return}let w=O8(E),x=m==="csv"?D8(w,h):M8(w),_=m==="csv"?"csv":"md",A=`${R1(u,"table","table")}.${_}`;_a(A,x,m==="csv"?"text/csv":"text/markdown"),a(!1),r==null||r(m)}catch(y){n==null||n(y)}};return k.useEffect(()=>{let m=b=>{let y=b.composedPath();o.current&&!y.includes(o.current)&&a(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]),v.jsxs("div",{className:i("relative"),ref:o,children:[v.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>a(!s),title:c.downloadTable,type:"button",children:e??v.jsx(d.DownloadIcon,{size:14})}),s?v.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>f("csv"),title:c.downloadTableAsCsv,type:"button",children:c.tableFormatCsv}),v.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>f("markdown"),title:c.downloadTableAsMarkdown,type:"button",children:c.tableFormatMarkdown})]}):null]})},Wre=({children:e,className:t,showCopy:r=!0,showDownload:n=!0})=>{let{Maximize2Icon:i,XIcon:s}=pn(),a=We(),[o,l]=k.useState(!1),{isAnimating:u,portal:c}=k.useContext(Zt),d=zn(),h=()=>{l(!0)},f=()=>{l(!1)};return k.useEffect(()=>{if(o){O1();let m=b=>{b.key==="Escape"&&l(!1)};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),L1()}}},[o]),v.jsxs(v.Fragment,{children:[v.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:h,title:d.viewFullscreen,type:"button",children:v.jsx(i,{size:14})}),o?$a.createPortal(v.jsx("div",{"aria-label":d.viewFullscreen,"aria-modal":"true",className:a("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:m=>{m.key==="Escape"&&f()},role:"dialog",children:v.jsxs("div",{className:a("flex h-full flex-col"),"data-streamdown":"table-wrapper",onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),role:"presentation",children:[v.jsxs("div",{className:a("flex items-center justify-end gap-1 p-4"),children:[r?v.jsx(B8,{}):null,n?v.jsx(F8,{}):null,v.jsx("button",{className:a("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:d.exitFullscreen,type:"button",children:v.jsx(s,{size:20})})]}),v.jsx("div",{className:a("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:v.jsx("table",{className:a("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),P1(c)):null]})},Zre=({children:e,className:t,maxHeight:r,showControls:n,showCopy:i=!0,showDownload:s=!0,showFullscreen:a=!0,...o})=>{let l=We(),{isAnimating:u}=k.useContext(Zt),c=w8(r),d=k8(u,!!c,e),h=n&&i,f=n&&s,m=n&&a,b=h||f||m;return v.jsxs("div",{className:l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[b?v.jsxs("div",{className:l("flex items-center justify-end gap-1"),children:[h?v.jsx(B8,{}):null,f?v.jsx(F8,{}):null,m?v.jsx(Wre,{showCopy:h,showDownload:f,children:e}):null]}):null,v.jsx("div",{className:l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),ref:d,style:c?{maxHeight:c}:void 0,children:v.jsx("table",{className:l("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},Yre=/startLine=(\d+)/,Kre=/\bnoLineNumbers\b/,Xre=k.lazy(()=>O(()=>Promise.resolve().then(()=>a0e),void 0).then(e=>({default:e.Mermaid}))),Qre=/language-([^\s]+)/,Jre="node";function mt(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;let n=e,i=t;for(let s of r)if(s!==Jre&&!Object.is(n[s],i[s]))return!1;return!0}function ene(e,t){var r,n;return((r=e==null?void 0:e.properties)==null?void 0:r.metastring)===((n=t==null?void 0:t.properties)==null?void 0:n.metastring)}var zc=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,hh=(e,t)=>{if(typeof e=="boolean")return e;let r=e.table;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},Fy=(e,t)=>{if(typeof e=="boolean")return e;let r=e.code;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},wu=(e,t)=>{if(typeof e=="boolean")return e;let r=e.mermaid;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},tne=(e,t)=>{if(typeof e=="boolean")return e;let r=e.image;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},B1=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e})},(e,t)=>mt(e,t));B1.displayName="MarkdownOl";var z8=k.memo(({children:e,className:t,node:r,...n})=>{var i;let s=We(),a=Array.isArray(e)?e.filter(l=>l!==`
765
+ `)},B8=({children:e,className:t,onCopy:r,onError:n,timeout:i=2e3})=>{let s=We(),[a,o]=k.useState(!1),[l,u]=k.useState(!1),c=k.useRef(null),d=k.useRef(0),{isAnimating:h,controls:f}=k.useContext(Zt),m=zn(),b=L8(f),y=async x=>{var _,A;if(typeof window>"u"||!((_=navigator==null?void 0:navigator.clipboard)!=null&&_.write)){n==null||n(new Error("Clipboard API not available"));return}try{let S=(A=c.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),I=S==null?void 0:S.querySelector("table");if(!I){n==null||n(new Error("Table not found"));return}let N=O8(I),U="";x==="csv"?U=D8(N,b):x==="tsv"?U=Gre(N):U=M8(N);let z=new ClipboardItem({"text/plain":new Blob([U],{type:"text/plain"}),"text/html":new Blob([I.outerHTML],{type:"text/html"})});await navigator.clipboard.write([z]),u(!0),o(!1),r==null||r(x),d.current=window.setTimeout(()=>u(!1),i)}catch(S){n==null||n(S)}};k.useEffect(()=>{let x=_=>{let A=_.composedPath();c.current&&!A.includes(c.current)&&o(!1)};return document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x),window.clearTimeout(d.current)}},[]);let E=pn(),w=l?E.CheckIcon:E.CopyIcon;return v.jsxs("div",{className:s("relative"),ref:c,children:[v.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>o(!a),title:m.copyTable,type:"button",children:e??v.jsx(w,{height:14,width:14})}),a?v.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("md"),title:m.copyTableAsMarkdown,type:"button",children:m.tableFormatMarkdown}),v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("csv"),title:m.copyTableAsCsv,type:"button",children:m.tableFormatCsv}),v.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>y("tsv"),title:m.copyTableAsTsv,type:"button",children:m.tableFormatTsv})]}):null]})},F8=({children:e,className:t,onDownload:r,onError:n})=>{let i=We(),[s,a]=k.useState(!1),o=k.useRef(null),{isAnimating:l,controls:u}=k.useContext(Zt),c=zn(),d=pn(),h=L8(u),f=m=>{var b;try{let y=(b=o.current)==null?void 0:b.closest('[data-streamdown="table-wrapper"]'),E=y==null?void 0:y.querySelector("table");if(!E){n==null||n(new Error("Table not found"));return}let w=O8(E),x=m==="csv"?D8(w,h):M8(w),_=m==="csv"?"csv":"md",A=`${R1(u,"table","table")}.${_}`;_a(A,x,m==="csv"?"text/csv":"text/markdown"),a(!1),r==null||r(m)}catch(y){n==null||n(y)}};return k.useEffect(()=>{let m=b=>{let y=b.composedPath();o.current&&!y.includes(o.current)&&a(!1)};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]),v.jsxs("div",{className:i("relative"),ref:o,children:[v.jsx("button",{className:i("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:()=>a(!s),title:c.downloadTable,type:"button",children:e??v.jsx(d.DownloadIcon,{size:14})}),s?v.jsxs("div",{className:i("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[v.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>f("csv"),title:c.downloadTableAsCsv,type:"button",children:c.tableFormatCsv}),v.jsx("button",{className:i("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>f("markdown"),title:c.downloadTableAsMarkdown,type:"button",children:c.tableFormatMarkdown})]}):null]})},Wre=({children:e,className:t,showCopy:r=!0,showDownload:n=!0})=>{let{Maximize2Icon:i,XIcon:s}=pn(),a=We(),[o,l]=k.useState(!1),{isAnimating:u,portal:c}=k.useContext(Zt),d=zn(),h=()=>{l(!0)},f=()=>{l(!1)};return k.useEffect(()=>{if(o){O1();let m=b=>{b.key==="Escape"&&l(!1)};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),L1()}}},[o]),v.jsxs(v.Fragment,{children:[v.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:h,title:d.viewFullscreen,type:"button",children:v.jsx(i,{size:14})}),o?$a.createPortal(v.jsx("div",{"aria-label":d.viewFullscreen,"aria-modal":"true",className:a("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:f,onKeyDown:m=>{m.key==="Escape"&&f()},role:"dialog",children:v.jsxs("div",{className:a("flex h-full flex-col"),"data-streamdown":"table-wrapper",onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),role:"presentation",children:[v.jsxs("div",{className:a("flex items-center justify-end gap-1 p-4"),children:[r?v.jsx(B8,{}):null,n?v.jsx(F8,{}):null,v.jsx("button",{className:a("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:f,title:d.exitFullscreen,type:"button",children:v.jsx(s,{size:20})})]}),v.jsx("div",{className:a("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:v.jsx("table",{className:a("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),P1(c)):null]})},Zre=({children:e,className:t,maxHeight:r,showControls:n,showCopy:i=!0,showDownload:s=!0,showFullscreen:a=!0,...o})=>{let l=We(),{isAnimating:u}=k.useContext(Zt),c=w8(r),d=k8(u,!!c,e),h=n&&i,f=n&&s,m=n&&a,b=h||f||m;return v.jsxs("div",{className:l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[b?v.jsxs("div",{className:l("flex items-center justify-end gap-1"),children:[h?v.jsx(B8,{}):null,f?v.jsx(F8,{}):null,m?v.jsx(Wre,{showCopy:h,showDownload:f,children:e}):null]}):null,v.jsx("div",{className:l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),ref:d,style:c?{maxHeight:c}:void 0,children:v.jsx("table",{className:l("w-full divide-y divide-border",t),"data-streamdown":"table",...o,children:e})})]})},Yre=/startLine=(\d+)/,Kre=/\bnoLineNumbers\b/,Xre=k.lazy(()=>O(()=>Promise.resolve().then(()=>o0e),void 0).then(e=>({default:e.Mermaid}))),Qre=/language-([^\s]+)/,Jre="node";function mt(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;let n=e,i=t;for(let s of r)if(s!==Jre&&!Object.is(n[s],i[s]))return!1;return!0}function ene(e,t){var r,n;return((r=e==null?void 0:e.properties)==null?void 0:r.metastring)===((n=t==null?void 0:t.properties)==null?void 0:n.metastring)}var zc=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,hh=(e,t)=>{if(typeof e=="boolean")return e;let r=e.table;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},Fy=(e,t)=>{if(typeof e=="boolean")return e;let r=e.code;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},wu=(e,t)=>{if(typeof e=="boolean")return e;let r=e.mermaid;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},tne=(e,t)=>{if(typeof e=="boolean")return e;let r=e.image;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},B1=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("ol",{className:i("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e})},(e,t)=>mt(e,t));B1.displayName="MarkdownOl";var z8=k.memo(({children:e,className:t,node:r,...n})=>{var i;let s=We(),a=Array.isArray(e)?e.filter(l=>l!==`
766
766
  `&&l!==""):[e],o=a.length===1&&k.isValidElement(a[0])&&(a[0].type===F1||((i=a[0].props.node)==null?void 0:i.tagname)==="p")?a[0].props.children:e;return v.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:o})},(e,t)=>mt(e,t));z8.displayName="MarkdownLi";var $8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("ul",{className:i("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e})},(e,t)=>mt(e,t));$8.displayName="MarkdownUl";var j8=k.memo(({className:e,node:t,...r})=>{let n=We();return v.jsx("hr",{className:n("my-6 border-border",e),"data-streamdown":"horizontal-rule",...r})},(e,t)=>mt(e,t));j8.displayName="MarkdownHr";var U8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("span",{className:i("font-semibold",t),"data-streamdown":"strong",...n,children:e})},(e,t)=>mt(e,t));U8.displayName="MarkdownStrong";var rne=({children:e,className:t,href:r,node:n,...i})=>{let s=We(),{linkSafety:a}=k.useContext(Zt),[o,l]=k.useState(!1),u=r==="streamdown:incomplete-link",c=k.useCallback(async m=>{if(!(!(a!=null&&a.enabled&&r)||u)){if(m.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(r)){window.open(r,"_blank","noreferrer");return}l(!0)}},[a,r,u]),d=k.useCallback(()=>{r&&window.open(r,"_blank","noreferrer")},[r]),h=k.useCallback(()=>{l(!1)},[]),f={url:r??"",isOpen:o,onClose:h,onConfirm:d};return a!=null&&a.enabled&&r?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:s("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:c,type:"button",children:e}),a.renderModal?a.renderModal(f):v.jsx(Ore,{...f})]}):v.jsx("a",{className:s("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:r,rel:"noreferrer",target:"_blank",...i,children:e})},H8=k.memo(rne,(e,t)=>mt(e,t));H8.displayName="MarkdownA";var V8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h1",{className:i("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e})},(e,t)=>mt(e,t));V8.displayName="MarkdownH1";var q8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h2",{className:i("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e})},(e,t)=>mt(e,t));q8.displayName="MarkdownH2";var G8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h3",{className:i("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e})},(e,t)=>mt(e,t));G8.displayName="MarkdownH3";var W8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h4",{className:i("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e})},(e,t)=>mt(e,t));W8.displayName="MarkdownH4";var Z8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h5",{className:i("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e})},(e,t)=>mt(e,t));Z8.displayName="MarkdownH5";var Y8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("h6",{className:i("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e})},(e,t)=>mt(e,t));Y8.displayName="MarkdownH6";var K8=k.memo(({children:e,className:t,node:r,...n})=>{let{controls:i,tableMaxHeight:s}=k.useContext(Zt),a=zc(i,"table"),o=hh(i,"copy"),l=hh(i,"download"),u=hh(i,"fullscreen");return v.jsx(Zre,{className:t,maxHeight:s,showControls:a,showCopy:o,showDownload:l,showFullscreen:u,...n,children:e})},(e,t)=>mt(e,t));K8.displayName="MarkdownTable";var X8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("thead",{className:i("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e})},(e,t)=>mt(e,t));X8.displayName="MarkdownThead";var Q8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("tbody",{className:i("divide-y divide-border",t),"data-streamdown":"table-body",...n,children:e})},(e,t)=>mt(e,t));Q8.displayName="MarkdownTbody";var J8=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("tr",{className:i("border-border",t),"data-streamdown":"table-row",...n,children:e})},(e,t)=>mt(e,t));J8.displayName="MarkdownTr";var ew=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("th",{className:i("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e})},(e,t)=>mt(e,t));ew.displayName="MarkdownTh";var tw=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("td",{className:i("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e})},(e,t)=>mt(e,t));tw.displayName="MarkdownTd";var rw=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("blockquote",{className:i("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e})},(e,t)=>mt(e,t));rw.displayName="MarkdownBlockquote";var nw=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("sup",{className:i("text-sm",t),"data-streamdown":"superscript",...n,children:e})},(e,t)=>mt(e,t));nw.displayName="MarkdownSup";var iw=k.memo(({children:e,className:t,node:r,...n})=>{let i=We();return v.jsx("sub",{className:i("text-sm",t),"data-streamdown":"subscript",...n,children:e})},(e,t)=>mt(e,t));iw.displayName="MarkdownSub";var sw=k.memo(({children:e,className:t,node:r,...n})=>{if("data-footnotes"in n){let i=a=>{var o,l;if(!k.isValidElement(a))return!1;let u=Array.isArray(a.props.children)?a.props.children:[a.props.children],c=!1,d=!1;for(let h of u)if(h){if(typeof h=="string")h.trim()!==""&&(c=!0);else if(k.isValidElement(h))if(((o=h.props)==null?void 0:o["data-footnote-backref"])!==void 0)d=!0;else{let f=Array.isArray(h.props.children)?h.props.children:[h.props.children];for(let m of f){if(typeof m=="string"&&m.trim()!==""){c=!0;break}if(k.isValidElement(m)&&((l=m.props)==null?void 0:l["data-footnote-backref"])===void 0){c=!0;break}}}}return d&&!c},s=Array.isArray(e)?e.map(a=>{if(!k.isValidElement(a))return a;if(a.type===B1){let o=(Array.isArray(a.props.children)?a.props.children:[a.props.children]).filter(l=>!i(l));return o.length===0?null:{...a,props:{...a.props,children:o}}}return a}):e;return(Array.isArray(s)?s.some(a=>a!==null):s!==null)?v.jsx("section",{className:t,...n,children:s}):null}return v.jsx("section",{className:t,...n,children:e})},(e,t)=>mt(e,t));sw.displayName="MarkdownSection";var nne=({node:e,className:t,children:r,...n})=>{var i,s;let a=We(),o=!("data-block"in n),{mermaid:l,controls:u,lineNumbers:c}=k.useContext(Zt),d=M1(),h=T8(),f=t==null?void 0:t.match(Qre),m=(i=f==null?void 0:f.at(1))!=null?i:"",b=Lre(m);if(o)return v.jsx("code",{className:a("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:r});let y=(s=e==null?void 0:e.properties)==null?void 0:s.metastring,E=y==null?void 0:y.match(Yre),w=E?Number.parseInt(E[1],10):void 0,x=w!==void 0&&w>=1?w:void 0,_=!(y&&Kre.test(y))&&c!==!1,A="";if(k.isValidElement(r)&&r.props&&typeof r.props=="object"&&"children"in r.props&&typeof r.props.children=="string"?A=r.props.children:typeof r=="string"&&(A=r),b){let Z=b.component;return v.jsx(k.Suspense,{fallback:v.jsx(Dy,{}),children:v.jsx(Z,{code:A,isIncomplete:h,language:m,meta:y})})}if(m==="mermaid"&&d){let Z=zc(u,"mermaid"),V=wu(u,"download"),ae=wu(u,"copy"),J=wu(u,"fullscreen"),Y=wu(u,"panZoom"),de=Z&&(V||ae||J);return v.jsx(k.Suspense,{fallback:v.jsx(Dy,{}),children:v.jsxs("div",{className:a("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[v.jsx("div",{className:a("flex h-8 items-center text-muted-foreground text-xs"),children:v.jsx("span",{className:a("ml-1 font-mono lowercase"),children:"mermaid"})}),de?v.jsx("div",{className:a("pointer-events-none absolute top-2 right-2 z-10 flex items-center"),children:v.jsxs("div",{className:a("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[V?v.jsx(P8,{chart:A,config:l==null?void 0:l.config}):null,ae?v.jsx(lm,{code:A,...Oy(u,"mermaid")}):null,J?v.jsx(qre,{chart:A,config:l==null?void 0:l.config}):null]})}):null,v.jsx("div",{className:a("overflow-hidden rounded-md border border-border bg-background"),children:v.jsx(Xre,{chart:A,config:l==null?void 0:l.config,showControls:Y})})]})})}let S=zc(u,"code"),I=Fy(u,"download"),N=Fy(u,"copy"),{"data-block":U,...z}=n;return v.jsx(yre,{className:t,code:A,isIncomplete:h,language:m,lineNumbers:_,startLine:x,...z,children:S?v.jsxs(v.Fragment,{children:[I?v.jsx(Nre,{code:A,language:m}):null,N?v.jsx(lm,{...Oy(u,"code")}):null]}):null})},aw=k.memo(nne,(e,t)=>mt(e,t)&&ene(e.node,t.node));aw.displayName="MarkdownCode";var ine=({node:e,className:t,...r})=>{let{controls:n}=k.useContext(Zt),i=zc(n,"image"),s=i&&tne(n,"download");return v.jsx(Pre,{className:t,node:e,showControls:i,showDownloadControl:s,...r})},ow=k.memo(ine,(e,t)=>mt(e,t));ow.displayName="MarkdownImg";var F1=k.memo(({children:e,node:t,...r})=>{let n=(Array.isArray(e)?e:[e]).filter(i=>i!=null&&i!=="");if(n.length===1&&k.isValidElement(n[0])){let i=n[0].props.node,s=i==null?void 0:i.tagName;if(s==="img")return v.jsx(v.Fragment,{children:e});if(s==="code"&&"data-block"in n[0].props)return v.jsx(v.Fragment,{children:e})}return v.jsx("p",{...r,children:e})},(e,t)=>mt(e,t));F1.displayName="MarkdownParagraph";var sne={ol:B1,li:z8,ul:$8,hr:j8,strong:U8,a:H8,h1:V8,h2:q8,h3:G8,h4:W8,h5:Z8,h6:Y8,table:K8,thead:X8,tbody:Q8,tr:J8,th:ew,td:tw,blockquote:rw,code:aw,img:ow,pre:({children:e})=>k.isValidElement(e)?k.cloneElement(e,{"data-block":"true"}):e,sup:nw,sub:iw,p:F1,section:sw},ane=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,one=new RegExp("\\p{L}","u");function lw(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,"").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,""),r,n=0,i=0;for(let s of t){if(ane.test(s)){r!=null||(r="rtl"),i+=1;continue}one.test(s)&&(r!=null||(r="ltr"),n+=1)}return i>n?"rtl":n>i?"ltr":r??"ltr"}var lne=/^[ \t]{0,3}(`{3,}|~{3,})/,une=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,zy=e=>{let t=e.split(`
767
767
  `),r=null,n=0;for(let i of t){let s=lne.exec(i);if(r===null){if(s){let a=s[1];r=a[0],n=a.length}}else if(s){let a=s[1],o=a[0],l=a.length;o===r&&l>=n&&(r=null,n=0)}}return r!==null},cne=e=>{let t=e.split(`
768
768
  `);for(let r of t){let n=r.trim();if(n.length>0&&n.includes("|")&&une.test(n))return!0}return!1},dne=()=>e=>{Yr(e,"html",(t,r,n)=>{!n||typeof r!="number"||(n.children[r]={type:"text",value:t.value})})},$y=[],jy={allowDangerousHtml:!0},ku=new WeakMap,hne=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let r=e.rehypePlugins,n=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(r||n||i)){let c="default";return this.keyCache.set(e,c),c}let s=c=>{if(!c||c.length===0)return"";let d="";for(let h=0;h<c.length;h+=1){let f=c[h];if(h>0&&(d+=","),Array.isArray(f)){let[m,b]=f;if(typeof m=="function"){let y=ku.get(m);y||(y=m.name,ku.set(m,y)),d+=y}else d+=String(m);d+=":",d+=JSON.stringify(b)}else if(typeof f=="function"){let m=ku.get(f);m||(m=f.name,ku.set(f,m)),d+=m}else d+=String(f)}return d},a=s(r),o=s(n),l=i?JSON.stringify(i):"",u=`${o}::${a}::${l}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(e,t){let r=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(r,t)}clear(){this.cache.clear()}},Uy=new hne,uw=e=>{let t=fne(e),r=e.children||"",n=t.runSync(t.parse(r),r);return xne(n,e)},fne=e=>{let t=Uy.get(e);if(t)return t;let r=pne(e);return Uy.set(e,r),r},mne=e=>e.some(t=>Array.isArray(t)?t[0]===Yf:t===Yf),pne=e=>{let t=e.rehypePlugins||$y,r=e.remarkPlugins||$y,n=mne(t)?r:[...r,dne],i=e.remarkRehypeOptions?{...jy,...e.remarkRehypeOptions}:jy;return Mee().use(DJ).use(n).use(bee,i).use(t)},gne=e=>e,bne=(e,t,r,n)=>{r?e.children.splice(t,1):e.children[t]={type:"text",value:n}},yne=(e,t)=>{var r;for(let n in rh)if(Object.hasOwn(rh,n)&&Object.hasOwn(e.properties,n)){let i=e.properties[n],s=rh[n];(s===null||s.includes(e.tagName))&&(e.properties[n]=(r=t(String(i||""),n,e))!=null?r:void 0)}},vne=(e,t,r,n,i,s)=>{let a=!1;return n?a=!n.includes(e.tagName):i&&(a=i.includes(e.tagName)),!a&&s&&typeof t=="number"&&(a=!s(e,t,r)),a},xne=(e,t)=>{let{allowElement:r,allowedElements:n,disallowedElements:i,skipHtml:s,unwrapDisallowed:a,urlTransform:o}=t;if(r||n||i||s||o){let l=o||gne;Yr(e,(u,c,d)=>{if(u.type==="raw"&&d&&typeof c=="number")return bne(d,c,s,u.value),c;if(u.type==="element"&&(yne(u,l),vne(u,c,d,n,i,r)&&d&&typeof c=="number"))return a&&u.children?d.children.splice(c,1,...u.children):d.children.splice(c,1),c})}return HQ(e,{Fragment:v.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0})},Ene=/\[\^[\w-]{1,200}\](?!:)/,_ne=/\[\^[\w-]{1,200}\]:/,Tne=/<([A-Za-z][\w:-]*)[\s>/]/,wne=/^ {0,3}\[[^\]]+\]:/m,kne=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Hy=new Map,Vy=new Map,Sne=e=>{let t=e.toLowerCase(),r=Hy.get(t);if(r)return r;let n=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Hy.set(t,n),n},Ane=e=>{let t=e.toLowerCase(),r=Vy.get(t);if(r)return r;let n=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return Vy.set(t,n),n},qy=(e,t)=>{if(kne.has(t.toLowerCase()))return 0;let r=e.match(Sne(t));if(!r)return 0;let n=0;for(let i of r)i.trimEnd().endsWith("/>")||(n+=1);return n},Gy=(e,t)=>{let r=e.match(Ane(t));return r?r.length:0},Cne=e=>{let t=0;for(let r=0;r<e.length-1;r+=1)e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},Ine=/\r\n|\r/g,cw=e=>new zr({gfm:!0}).blockTokens(e),ra=null,Nne=`
@@ -790,4 +790,4 @@ ${h}`,i=e.length;break}if(!u.startsWith(`
790
790
 
791
791
  ${d}`,i=e.length;break}return i===0?e:n+e.slice(i)},zne=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let i=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(i,(s,a,o,l)=>Bne(a,o,l)),r=Fne(r,n)}return r},$ne=/([\\`*_~[\]|])/g,jne=e=>e.replace($ne,"\\$1"),Une=(e,t)=>{if(!t.length)return e;let r=e;for(let n of t){let i=new RegExp(`(<${n}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${n}\\s*>)`,"gi");r=r.replace(i,(s,a,o,l)=>{let u=jne(o).replace(/\n\n/g,"&#10;&#10;");return a+u+l})}return r},Hne=new Set(["blockquote","dd","dt","figcaption","h1","h2","h3","h4","h5","h6","li","p","td","th"]),fw=new Set(["code","kbd","pre","samp","var"]);function mw(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"&&!fw.has(t.tagName)?mw(t):"").join("")}function Vne(){return e=>{Yr(e,"element",t=>{if(fw.has(t.tagName)){t.properties!=null||(t.properties={}),t.properties.dir="ltr";return}Hne.has(t.tagName)&&(t.properties!=null||(t.properties={}),typeof t.properties.dir!="string"&&(t.properties.dir=lw(mw(t))))})}}var pw=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(pw).join(""):"",qne=e=>t=>{if(!e||e.length===0)return;let r=new Set(e.map(n=>n.toLowerCase()));Yr(t,"element",n=>{if(r.has(n.tagName.toLowerCase())){let i=pw(n);n.children=i?[{type:"text",value:i}]:[]}})},Gne=()=>e=>{Yr(e,"code",t=>{var r,n;t.meta&&(t.data=(r=t.data)!=null?r:{},t.data.hProperties={...(n=t.data.hProperties)!=null?n:{},metastring:t.meta})})},Wne=/^([a-zA-Z][a-zA-Z\d+\-.]*:)/,Zne=e=>new Set(e.map(t=>t.trim().toLowerCase()).filter(t=>t.length>0).map(t=>t.endsWith(":")?t:`${t}:`));function Yne(e,t,r){var n,i;let s=(i=(n=e.position)==null?void 0:n.start)==null?void 0:i.offset;if(typeof s=="number"&&r.charCodeAt(s)===91||e.children.length!==1)return!1;let[a]=e.children;if(a.type!=="text")return!1;let o=Wne.exec(e.url);if(!o)return!1;let l=o[1].toLowerCase();return t.has(l)?l==="mailto:"?e.url===`mailto:${a.value}`:e.url===a.value||e.url===`${l}//${a.value}`:!1}var Kne=(e=[])=>{let t=Zne(e);return(r,n)=>{var i;if(t.size===0)return;let s=String((i=n.value)!=null?i:"");Yr(r,"link",(a,o,l)=>{if(!(!l||o===void 0)&&Yne(a,t,s))return l.children.splice(o,1,...a.children),o})}},Wy="data-sd-caret-hidden",Xne=e=>{let t=k.useRef(null),r=k.useRef(null),[n,i]=k.useState(!1);return k.useEffect(()=>i(!0),[]),k.useLayoutEffect(()=>{var s,a;let o=e&&(a=(s=t.current)==null?void 0:s.lastElementChild)!=null?a:null,l=r.current;l!==o&&(l==null||l.removeAttribute(Wy),o==null||o.setAttribute(Wy,""),r.current=o)}),{containerRef:t,showCaret:n||!e}},Zy=/^[a-z]/,Qne=/^[ \t]*<[\w!/?-]/,Jne=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,eie=e=>typeof e!="string"||e.length===0||!Qne.test(e)?e:e.replace(Jne,"$1"),Yy,Ky,Xy,Qy,Jy,e3,Hu={...Ti,clobberPrefix:"",protocols:{...Ti.protocols,href:[...(Ky=(Yy=Ti.protocols)==null?void 0:Yy.href)!=null?Ky:[],"tel","streamdown"],src:[...(Qy=(Xy=Ti.protocols)==null?void 0:Xy.src)!=null?Qy:[],"streamdown"]},attributes:{...Ti.attributes,code:[...(e3=(Jy=Ti.attributes)==null?void 0:Jy.code)!=null?e3:[],"metastring"]}},Ba={raw:Yf,sanitize:[o7,Hu],harden:[GH,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},tie={gfm:[HK,{}],codeMeta:Gne},t3=Object.values(Ba),rie=Object.values(tie),nie={block:" ▋",circle:" ●"},gw=["github-light","github-dark"],bw={enabled:!0},iie={codeBlockMaxHeight:400,shikiTheme:gw,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:bw,portal:void 0,tableMaxHeight:300},Zt=k.createContext(iie),yw=k.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:r,index:n,isIncomplete:i,dir:s,animatePlugin:a,...o})=>{k.useLayoutEffect(()=>{a==null||a.commit()});let l=typeof e=="string"&&r?eie(e):e,u=v.jsx(uw,{...o,children:l});return v.jsx(_8.Provider,{value:i,children:s?v.jsx("div",{dir:s,style:{display:"contents"},children:u}):u})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let r=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(r.length!==n.length||r.some(i=>{var s,a;return((s=e.components)==null?void 0:s[i])!==((a=t.components)==null?void 0:a[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins||!!e.animatePlugin!=!!t.animatePlugin)});yw.displayName="Block";var z1=k.memo(({children:e,mode:t="streaming",dir:r,parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:i=!1,components:s,rehypePlugins:a=t3,remarkPlugins:o=rie,className:l,shikiTheme:u,mermaid:c,codeBlockMaxHeight:d=400,controls:h=!0,isAnimating:f=!1,tableMaxHeight:m=300,animated:b,BlockComponent:y=yw,parseMarkdownIntoBlocksFn:E=Lne,caret:w,plugins:x,remend:_,linkSafety:A=bw,portal:S,lineNumbers:I=!0,allowedTags:N,fallbackComponent:U,literalTagContent:z,disableAutolinkProtocols:Z,translations:V,icons:ae,prefix:J,onAnimationStart:Y,onAnimationEnd:de,...xe})=>{let Ue=k.useId(),He=k.useMemo(()=>lre(J),[J]),L=k.useRef(null),Re=k.useRef(Y),Q=k.useRef(de);Re.current=Y,Q.current=de,k.useEffect(()=>{var Se,W,ne;if(t==="static")return;let Ee=L.current;if(L.current=f,Ee===null){f&&((Se=Re.current)==null||Se.call(Re));return}f&&!Ee?(W=Re.current)==null||W.call(Re):!f&&Ee&&((ne=Q.current)==null||ne.call(Q))},[f,t]);let M=k.useMemo(()=>N?Object.keys(N):[],[N]),pe=k.useMemo(()=>{if(typeof e!="string")return"";let Se=t==="streaming"&&n?IQ(e,_):e;return z&&z.length>0&&(Se=Une(Se,z)),M.length>0&&(Se=zne(Se,M)),Se},[e,t,n,_,M,z]),oe=k.useMemo(()=>E(pe),[pe,E]),fe=k.useMemo(()=>r==="auto"?oe.map(lw):void 0,[oe,r]),Ae=k.useMemo(()=>oe.map((Se,W)=>`${Ue}-${W}`),[oe.length,Ue]),ze=k.useMemo(()=>b===!0?"true":b?JSON.stringify(b):"",[b]),re=k.useRef(null),Le=k.useRef([]),et=k.useRef([]),Te=k.useRef(null),Ke=k.useRef("");if(ze){if(Ke.current!==ze){Ke.current=ze;let Se=ze!=="true"?b.maxBacklogMs:void 0;re.current=Iy({maxBacklogMs:Se}),Le.current=[],et.current=[]}else re.current||(re.current=Iy());f&&re.current&&re.current.beginPass(re.current.now())}else re.current=null,Le.current=[],et.current=[],Ke.current="";k.useLayoutEffect(()=>{var Se;f&&((Se=re.current)==null||Se.commitPass())});let ot=k.useMemo(()=>{var Se,W;return{codeBlockMaxHeight:d,shikiTheme:(W=u??((Se=x==null?void 0:x.code)==null?void 0:Se.getThemes()))!=null?W:gw,controls:h,isAnimating:f,lineNumbers:I,mode:t,mermaid:c,linkSafety:A,portal:S,tableMaxHeight:m}},[d,u,h,f,I,t,c,A,S,x==null?void 0:x.code,m]),Rt=k.useMemo(()=>V?JSON.stringify(V):"",[V]),bn=k.useMemo(()=>({...I8,...V}),[Rt]),Jr=k.useMemo(()=>{let{inlineCode:Se,...W}=s??{},ne={...sne,...W};if(Se){let Ee=ne.code;ne.code=ke=>"data-block"in ke?Ee?k.createElement(Ee,ke):null:k.createElement(Se,ke)}if(U){if(N)for(let ke of Object.keys(N))Object.hasOwn(ne,ke)||(ne[ke]=U);let Ee={configurable:!0,enumerable:!1,value:U,writable:!1};return new Proxy(ne,{getOwnPropertyDescriptor(ke,$e){let jt=Object.getOwnPropertyDescriptor(ke,$e);if(jt)return jt;if(typeof $e=="string"&&Zy.test($e))return Ee},get(ke,$e,jt){return typeof $e=="string"&&Zy.test($e)&&!Object.hasOwn(ke,$e)?U:Reflect.get(ke,$e,jt)}})}return ne},[s,U,N]),$n=k.useMemo(()=>{let Se=[];return x!=null&&x.cjk&&(Se=[...Se,...x.cjk.remarkPluginsBefore]),Se=[...Se,...o],Z&&Z.length>0&&(Se=[...Se,[Kne,Z]]),x!=null&&x.cjk&&(Se=[...Se,...x.cjk.remarkPluginsAfter]),x!=null&&x.math&&(Se=[...Se,x.math.remarkPlugin]),Se},[o,x==null?void 0:x.math,x==null?void 0:x.cjk,Z]),_r=k.useMemo(()=>{var Se;let W=a;if(N&&Object.keys(N).length>0&&a===t3){let ne={...Hu,tagNames:[...(Se=Hu.tagNames)!=null?Se:[],...Object.keys(N)],attributes:{...Hu.attributes,...N}};W=[Ba.raw,[o7,ne],Ba.harden]}return z&&z.length>0&&(W=[...W,[qne,z]]),x!=null&&x.math&&(W=[...W,x.math.rehypePlugin]),r==="auto"&&t==="static"&&(W=[...W,Vne]),W},[a,x==null?void 0:x.math,N,z,r,t]),en=k.useMemo(()=>w&&f?{"--streamdown-caret":`"${nie[w]}"`}:void 0,[w,f]),ao=k.useMemo(()=>{if(!f||oe.length===0)return!1;let Se=oe.at(-1);return zy(Se)||cne(Se)},[f,oe]),{containerRef:oo,showCaret:Qi}=Xne(ao),qs=Se=>{let W=null;if(re.current&&f){if(!Le.current[Se]){let Ee=ze&&ze!=="true"?b:{},{maxBacklogMs:ke,...$e}=Ee;Le.current[Se]=are({...$e,timeline:re.current})}W=Le.current[Se]}Te.current!==_r&&(et.current=[],Te.current=_r),W&&!et.current[Se]&&(et.current[Se]=[..._r,W.rehypePlugin]);let ne=W&&et.current[Se]?et.current[Se]:_r;return{blockAnimatePlugin:W,blockRehypePlugins:ne}};return t==="static"?v.jsx(om.Provider,{value:bn,children:v.jsx(um.Provider,{value:x??null,children:v.jsx(Zt.Provider,{value:ot,children:v.jsx(Py,{icons:ae,children:v.jsx(am.Provider,{value:He,children:v.jsx("div",{className:He("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",l),dir:r==="auto"?void 0:r,children:v.jsx(uw,{components:Jr,rehypePlugins:_r,remarkPlugins:$n,...xe,children:pe})})})})})})}):v.jsx(om.Provider,{value:bn,children:v.jsx(um.Provider,{value:x??null,children:v.jsx(Zt.Provider,{value:ot,children:v.jsx(Py,{icons:ae,children:v.jsx(am.Provider,{value:He,children:v.jsxs("div",{className:He("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",w&&Qi?"[&>*:last-child:not([data-sd-caret-hidden])]:after:inline [&>*:last-child:not([data-sd-caret-hidden])]:after:align-baseline [&>*:last-child:not([data-sd-caret-hidden])]:after:content-[var(--streamdown-caret)]":null,l),ref:oo,style:en,children:[oe.length===0&&w&&f&&v.jsx("span",{}),oe.map((Se,W)=>{var ne;let Ee=W===oe.length-1,ke=f&&Ee&&zy(Se),{blockAnimatePlugin:$e,blockRehypePlugins:jt}=qs(W);return v.jsx(y,{animatePlugin:$e,components:Jr,content:Se,dir:(ne=fe==null?void 0:fe[W])!=null?ne:r!=="auto"?r:void 0,index:W,isIncomplete:ke,rehypePlugins:jt,remarkPlugins:$n,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:n,...xe},Ae[W])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&e.disableAutolinkProtocols===t.disableAutolinkProtocols&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir&&e.fallbackComponent===t.fallbackComponent);z1.displayName="Streamdown";var _o=e=>e>0?e:null,sie=(e,t)=>{if(e.endsWith("px"))return _o(Number.parseFloat(e));if(e.endsWith("rem")){let r=Number.parseFloat(getComputedStyle(document.documentElement).fontSize||"16");return _o(Number.parseFloat(e)*r)}if(e.endsWith("em")){let r=Number.parseFloat(getComputedStyle(t).fontSize||"16");return _o(Number.parseFloat(e)*r)}if(e.endsWith("vh"))return _o(Number.parseFloat(e)/100*window.innerHeight);if(e.endsWith("%")){let r=t.parentElement;return r&&r.clientHeight>0?_o(Number.parseFloat(e)/100*r.clientHeight):null}return null},fh=(e,t)=>{let r=t.trim().toLowerCase();return!r||r==="none"||r==="auto"?null:sie(r,e)},aie=/^min\(\s*([^,]+)\s*,\s*([^)]+)\s*\)$/i,oie=(e,t)=>{let r=fh(e,t);if(r!=null)return r;let n=t.trim().match(aie);if(!n)return null;let i=fh(e,n[1].trim()),s=fh(e,n[2].trim());return i==null||s==null?null:Math.min(i,s)},lie=(e,t,r)=>{let n=t.clientWidth;if(!(n>0))return null;if(r){let c=t.clientHeight;if(!(c>0))return null;let d=Math.min(n/e.width,c/e.height,1);return!(d>0)||Number.isNaN(d)?null:{fitZoom:d,viewportHeight:null}}let i=Math.min(n/e.width,1);if(!(i>0)||Number.isNaN(i))return null;let s=e.height*i,a=null,o=t;for(;o&&a==null;){let c=getComputedStyle(o);a=oie(o,c.maxHeight),o=o.parentElement}let l=a!=null?Math.min(s,a):s,u=Math.min(i,l/e.height,1);return!(u>0)||Number.isNaN(u)?null:{fitZoom:u,viewportHeight:l}},uie=({children:e,className:t,contentSize:r,fitKey:n,minZoom:i=.5,maxZoom:s=3,zoomStep:a=.1,showControls:o=!0,initialZoom:l=1,isAutoFit:u=!1,fullscreen:c=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:h,ZoomOutIcon:f}=pn(),m=We(),b=zn(),y=k.useRef(null),E=k.useRef(null),w=k.useRef(!1),[x,_]=k.useState(l),[A,S]=k.useState(i),[I,N]=k.useState(l),[U,z]=k.useState({x:0,y:0}),[Z,V]=k.useState(!1),[ae,J]=k.useState({x:0,y:0}),[Y,de]=k.useState({x:0,y:0}),[xe,Ue]=k.useState(null),He=k.useCallback(re=>{let Le=y.current;if(!Le)return;let et=lie(re,Le,c);if(!et)return;let{fitZoom:Te,viewportHeight:Ke}=et;Ue(Ke),_(Te),S(Math.min(i,Te)),w.current||(N(Te),z({x:0,y:0}))},[c,i]),L=k.useCallback(re=>{N(Le=>Math.max(A,Math.min(s,Le+re))),w.current=!0},[A,s]),Re=k.useCallback(()=>{L(a)},[L,a]),Q=k.useCallback(()=>{L(-a)},[L,a]),M=k.useCallback(()=>{N(x),z({x:0,y:0}),w.current=!1},[x]),pe=k.useCallback(re=>{re.preventDefault();let Le=re.deltaY>0?-a:a;L(Le)},[L,a]),oe=k.useCallback(re=>{if(re.button!==0||re.isPrimary===!1)return;V(!0),w.current=!0,J({x:re.clientX,y:re.clientY}),de(U);let Le=re.currentTarget;Le instanceof HTMLElement&&Le.setPointerCapture(re.pointerId)},[U]),fe=k.useCallback(re=>{if(!Z)return;re.preventDefault();let Le=re.clientX-ae.x,et=re.clientY-ae.y;z({x:Y.x+Le,y:Y.y+et})},[Z,ae,Y]),Ae=k.useCallback(re=>{V(!1);let Le=re.currentTarget;Le instanceof HTMLElement&&Le.releasePointerCapture(re.pointerId)},[]);k.useEffect(()=>{S(i),u||(_(l),N(l),Ue(null))},[l,u,i]),k.useLayoutEffect(()=>{if(!(u&&r))return;He(r);let re=y.current;if(!re||typeof ResizeObserver>"u")return;let Le=new ResizeObserver(()=>{He(r)});return Le.observe(re),()=>{Le.disconnect()}},[He,r,u]),k.useEffect(()=>{u&&(w.current=!1)},[n,u]),k.useEffect(()=>{let re=y.current;if(re)return re.addEventListener("wheel",pe,{passive:!1}),()=>{re.removeEventListener("wheel",pe)}},[pe]),k.useEffect(()=>{let re=E.current;if(re&&Z)return document.body.style.userSelect="none",re.addEventListener("pointermove",fe,{passive:!1}),re.addEventListener("pointerup",Ae),re.addEventListener("pointercancel",Ae),()=>{document.body.style.userSelect="",re.removeEventListener("pointermove",fe),re.removeEventListener("pointerup",Ae),re.removeEventListener("pointercancel",Ae)}},[Z,fe,Ae]);let ze=!c&&u&&xe!=null?{height:xe}:void 0;return v.jsxs("div",{className:m("relative flex flex-col",c?"h-full w-full":"min-h-28 w-full",t),ref:y,style:{cursor:Z?"grabbing":"grab",...ze},children:[o?v.jsxs("div",{className:m("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",c?"bottom-4 left-4":"bottom-2 left-2"),children:[v.jsx("button",{"aria-label":b.zoomIn,className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:I>=s,onClick:Re,title:b.zoomIn,type:"button",children:v.jsx(h,{"aria-hidden":"true",size:16})}),v.jsx("button",{"aria-label":b.zoomOut,className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:I<=A,onClick:Q,title:b.zoomOut,type:"button",children:v.jsx(f,{"aria-hidden":"true",size:16})}),v.jsx("button",{"aria-label":b.resetView,className:m("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:M,title:b.resetView,type:"button",children:v.jsx(d,{"aria-hidden":"true",size:16})})]}):null,v.jsx("div",{className:m("flex h-full w-full flex-1 origin-center items-center justify-center transition-transform duration-150 ease-out"),onPointerDown:oe,ref:E,role:"application",style:{transform:`translate(${U.x}px, ${U.y}px) scale(${I})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},cie=(e,t)=>new Promise(r=>{let n=setTimeout(r,e);t(()=>{clearTimeout(n),r()})}),die=async(e,{chart:t,config:r},n)=>{try{let i=e.getMermaid(r),s=t.split("").reduce((u,c)=>(u<<5)-u+c.charCodeAt(0)|0,0),a=`mermaid-${Math.abs(s)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:o}=await i.render(a,t),l=R8(o);return{ok:!0,svg:n?o:Ure(o),size:l}}catch(i){return{ok:!1,error:i instanceof Error?i.message:"Failed to render Mermaid chart"}}},vw=({chart:e,className:t,config:r,fullscreen:n=!1,showControls:i=!0})=>{let s=We(),[a,o]=k.useState(null),[l,u]=k.useState(!1),[c,d]=k.useState(""),[h,f]=k.useState(null),[m,b]=k.useState(""),[y,E]=k.useState(0),{mermaid:w}=k.useContext(Zt),x=M1(),_=w==null?void 0:w.errorComponent,{shouldRender:A,containerRef:S}=Vte({immediate:n}),I=k.useRef(null),N=k.useRef(!1),U=k.useRef(!1),z=T8(),Z=k.useRef(z),V=k.useRef(null);k.useEffect(()=>(U.current=!0,()=>{var Y;U.current=!1,(Y=V.current)==null||Y.call(V)}),[]),k.useEffect(()=>{var Y;Z.current=z,z||(Y=V.current)==null||Y.call(V)},[z]);let ae=async Y=>{Z.current&&(await cie(Y,de=>{V.current=de}),V.current=null)};if(k.useEffect(()=>{if(!A)return;if(!x){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}if(I.current={chart:e,config:r},N.current)return;let Y=(de,xe)=>{xe.ok?(d(xe.svg),f(xe.size),b(xe.svg)):de===I.current&&o(xe.error)};(async()=>{N.current=!0,o(null),u(!0);try{let de=I.current;for(;de;){let xe=performance.now(),Ue=await die(x,de,n);if(!U.current||(Y(de,Ue),Ue.ok&&await ae(performance.now()-xe),!U.current||de===I.current))return;de=I.current}}finally{N.current=!1,U.current&&u(!1)}})()},[e,r,y,A,x]),!(A||c||m))return v.jsx("div",{className:s("my-4 min-h-[200px]",t),ref:S});if(l&&!c&&!m)return v.jsx("div",{className:s("my-4 flex justify-center p-4",t),ref:S,children:v.jsxs("div",{className:s("flex items-center space-x-2 text-muted-foreground"),children:[v.jsx("div",{className:s("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),v.jsx("span",{className:s("text-sm"),children:"Loading diagram..."})]})});if(a&&!c&&!m){let Y=()=>E(de=>de+1);return _?v.jsx("div",{ref:S,children:v.jsx(_,{chart:e,error:a,retry:Y})}):v.jsxs("div",{className:s("rounded-md bg-red-50 p-4",t),ref:S,children:[v.jsxs("p",{className:s("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",a]}),v.jsxs("details",{className:s("mt-2"),children:[v.jsx("summary",{className:s("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),v.jsx("pre",{className:s("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let J=c||m;return v.jsx("div",{className:s(n?"size-full":"max-h-[min(70vh,40rem)] w-full",t),"data-streamdown":"mermaid",ref:S,children:v.jsx(uie,{className:s(n?"size-full overflow-hidden":"max-h-[min(70vh,40rem)] overflow-hidden",t),contentSize:h,fitKey:e,fullscreen:n,isAutoFit:!0,maxZoom:3,minZoom:.1,showControls:i,zoomStep:.1,children:v.jsx("div",{"aria-label":"Mermaid chart",className:s("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:J},role:"img"})})})};const xw={code:K$,math:qH},[hie,fie]=Ba.harden,Ew=[Ba.raw,Ba.sanitize,[hie,{...fie,allowedImagePrefixes:[],allowDataImages:!1}]],mie=({className:e,from:t,...r})=>v.jsx("div",{className:Ie("group flex w-full max-w-[95%] flex-col gap-2",t==="user"?"is-user ml-auto justify-end":"is-assistant",e),...r}),pie=({children:e,className:t,...r})=>v.jsx("div",{className:Ie("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",t),...r,children:e}),_w=k.memo(({className:e,...t})=>v.jsx(z1,{className:Ie("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),plugins:xw,rehypePlugins:Ew,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);_w.displayName="MessageResponse";var r3=1,gie=.9,bie=.8,yie=.17,mh=.1,ph=.999,vie=.9999,xie=.99,Eie=/[\\\/_+.#"@\[\(\{&]/,_ie=/[\\\/_+.#"@\[\(\{&]/g,Tie=/[\s-]/,Tw=/[\s-]/g;function hm(e,t,r,n,i,s,a){if(s===t.length)return i===e.length?r3:xie;var o=`${i},${s}`;if(a[o]!==void 0)return a[o];for(var l=n.charAt(s),u=r.indexOf(l,i),c=0,d,h,f,m;u>=0;)d=hm(e,t,r,n,u+1,s+1,a),d>c&&(u===i?d*=r3:Eie.test(e.charAt(u-1))?(d*=bie,f=e.slice(i,u-1).match(_ie),f&&i>0&&(d*=Math.pow(ph,f.length))):Tie.test(e.charAt(u-1))?(d*=gie,m=e.slice(i,u-1).match(Tw),m&&i>0&&(d*=Math.pow(ph,m.length))):(d*=yie,i>0&&(d*=Math.pow(ph,u-i))),e.charAt(u)!==t.charAt(s)&&(d*=vie)),(d<mh&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(h=hm(e,t,r,n,u+1,s+2,a),h*mh>d&&(d=h*mh)),d>c&&(c=d),u=r.indexOf(l,u+1);return a[o]=c,c}function n3(e){return e.toLowerCase().replace(Tw," ")}function wie(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,hm(e,t,n3(e),n3(t),0,0,{})}var kie=Object.defineProperty,gn=(e,t)=>kie(e,"name",{value:t,configurable:!0});function ww(e){const t=k.forwardRef((r,n)=>{let{children:i,...s}=r,a=null,o=!1;const l=[];fm(i)&&typeof Su=="function"&&(i=Su(i._payload)),k.Children.forEach(i,h=>{var f;if(Cw(h)){o=!0;const m=h;let b="child"in m.props?m.props.child:m.props.children;fm(b)&&typeof Su=="function"&&(b=Su(b._payload)),a=Aie(m,b),l.push((f=a==null?void 0:a.props)==null?void 0:f.children)}else l.push(h)}),a?a=k.cloneElement(a,void 0,l):!o&&k.Children.count(i)===1&&k.isValidElement(i)&&(a=i);const u=a?Aw(a):void 0,c=si(n,u);if(!a){if(i||i===0)throw new Error(o?Nie(e):Iie(e));return i}const d=Sw(s,a.props??{});return a.type!==k.Fragment&&(d.ref=n?c:u),k.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}gn(ww,"createSlot");var kw=Symbol.for("radix.slottable");function Sie(e){const t=gn(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=kw,t}gn(Sie,"createSlottable");var Aie=gn((e,t)=>{if("child"in e.props){const r=e.props.child;return k.isValidElement(r)?k.cloneElement(r,void 0,e.props.children(r.props.children)):null}return k.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Sw(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}gn(Sw,"mergeProps");function Aw(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}gn(Aw,"getElementRef");function Cw(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kw}gn(Cw,"isSlottable");var Cie=Symbol.for("react.lazy");function fm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Cie&&"_payload"in e&&Iw(e._payload)}gn(fm,"isLazyComponent");function Iw(e){return typeof e=="object"&&e!==null&&"then"in e}gn(Iw,"isPromiseLike");var Iie=gn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Nie=gn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Su=Ms[" use ".trim().toString()],Rie=Object.defineProperty,Pie=(e,t)=>Rie(e,"name",{value:t,configurable:!0}),Oie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ki=Oie.reduce((e,t)=>{const r=ww(`Primitive.${t}`),n=k.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Lie(e,t){e&&$a.flushSync(()=>e.dispatchEvent(t))}Pie(Lie,"dispatchDiscreteCustomEvent");var Die=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},Mie=Ms[" useId ".trim().toString()]||(()=>{}),Bie=0;function Ta(e){const[t,r]=k.useState(Mie());return Die(()=>{r(n=>n??String(Bie++))},[e]),t?`radix-${t}`:""}var To='[cmdk-group=""]',gh='[cmdk-group-items=""]',Fie='[cmdk-group-heading=""]',Nw='[cmdk-item=""]',i3=`${Nw}:not([aria-disabled="true"])`,mm="cmdk-item-select",la="data-value",zie=(e,t,r)=>wie(e,t,r),Rw=k.createContext(void 0),Vl=()=>k.useContext(Rw),Pw=k.createContext(void 0),$1=()=>k.useContext(Pw),Ow=k.createContext(void 0),Lw=k.forwardRef((e,t)=>{let r=ua(()=>{var Q,M;return{search:"",value:(M=(Q=e.value)!=null?Q:e.defaultValue)!=null?M:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=ua(()=>new Set),i=ua(()=>new Map),s=ua(()=>new Map),a=ua(()=>new Set),o=Dw(e),{label:l,children:u,value:c,onValueChange:d,filter:h,shouldFilter:f,loop:m,disablePointerSelection:b=!1,vimBindings:y=!0,...E}=e,w=Ta(),x=Ta(),_=Ta(),A=k.useRef(null),S=Kie();Ds(()=>{if(c!==void 0){let Q=c.trim();r.current.value=Q,I.emit()}},[c]),Ds(()=>{S(6,ae)},[]);let I=k.useMemo(()=>({subscribe:Q=>(a.current.add(Q),()=>a.current.delete(Q)),snapshot:()=>r.current,setState:(Q,M,pe)=>{var oe,fe,Ae,ze;if(!Object.is(r.current[Q],M)){if(r.current[Q]=M,Q==="search")V(),z(),S(1,Z);else if(Q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(_);re?re.focus():(oe=document.getElementById(w))==null||oe.focus()}if(S(7,()=>{var re;r.current.selectedItemId=(re=J())==null?void 0:re.id,I.emit()}),pe||S(5,ae),((fe=o.current)==null?void 0:fe.value)!==void 0){let re=M??"";(ze=(Ae=o.current).onValueChange)==null||ze.call(Ae,re);return}}I.emit()}},emit:()=>{a.current.forEach(Q=>Q())}}),[]),N=k.useMemo(()=>({value:(Q,M,pe)=>{var oe;M!==((oe=s.current.get(Q))==null?void 0:oe.value)&&(s.current.set(Q,{value:M,keywords:pe}),r.current.filtered.items.set(Q,U(M,pe)),S(2,()=>{z(),I.emit()}))},item:(Q,M)=>(n.current.add(Q),M&&(i.current.has(M)?i.current.get(M).add(Q):i.current.set(M,new Set([Q]))),S(3,()=>{V(),z(),r.current.value||Z(),I.emit()}),()=>{s.current.delete(Q),n.current.delete(Q),r.current.filtered.items.delete(Q);let pe=J();S(4,()=>{V(),(pe==null?void 0:pe.getAttribute("id"))===Q&&Z(),I.emit()})}),group:Q=>(i.current.has(Q)||i.current.set(Q,new Set),()=>{s.current.delete(Q),i.current.delete(Q)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:w,inputId:_,labelId:x,listInnerRef:A}),[]);function U(Q,M){var pe,oe;let fe=(oe=(pe=o.current)==null?void 0:pe.filter)!=null?oe:zie;return Q?fe(Q,r.current.search,M):0}function z(){if(!r.current.search||o.current.shouldFilter===!1)return;let Q=r.current.filtered.items,M=[];r.current.filtered.groups.forEach(oe=>{let fe=i.current.get(oe),Ae=0;fe.forEach(ze=>{let re=Q.get(ze);Ae=Math.max(re,Ae)}),M.push([oe,Ae])});let pe=A.current;Y().sort((oe,fe)=>{var Ae,ze;let re=oe.getAttribute("id"),Le=fe.getAttribute("id");return((Ae=Q.get(Le))!=null?Ae:0)-((ze=Q.get(re))!=null?ze:0)}).forEach(oe=>{let fe=oe.closest(gh);fe?fe.appendChild(oe.parentElement===fe?oe:oe.closest(`${gh} > *`)):pe.appendChild(oe.parentElement===pe?oe:oe.closest(`${gh} > *`))}),M.sort((oe,fe)=>fe[1]-oe[1]).forEach(oe=>{var fe;let Ae=(fe=A.current)==null?void 0:fe.querySelector(`${To}[${la}="${encodeURIComponent(oe[0])}"]`);Ae==null||Ae.parentElement.appendChild(Ae)})}function Z(){let Q=Y().find(pe=>pe.getAttribute("aria-disabled")!=="true"),M=Q==null?void 0:Q.getAttribute(la);I.setState("value",M||void 0)}function V(){var Q,M,pe,oe;if(!r.current.search||o.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let fe=0;for(let Ae of n.current){let ze=(M=(Q=s.current.get(Ae))==null?void 0:Q.value)!=null?M:"",re=(oe=(pe=s.current.get(Ae))==null?void 0:pe.keywords)!=null?oe:[],Le=U(ze,re);r.current.filtered.items.set(Ae,Le),Le>0&&fe++}for(let[Ae,ze]of i.current)for(let re of ze)if(r.current.filtered.items.get(re)>0){r.current.filtered.groups.add(Ae);break}r.current.filtered.count=fe}function ae(){var Q,M,pe;let oe=J();oe&&(((Q=oe.parentElement)==null?void 0:Q.firstChild)===oe&&((pe=(M=oe.closest(To))==null?void 0:M.querySelector(Fie))==null||pe.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function J(){var Q;return(Q=A.current)==null?void 0:Q.querySelector(`${Nw}[aria-selected="true"]`)}function Y(){var Q;return Array.from(((Q=A.current)==null?void 0:Q.querySelectorAll(i3))||[])}function de(Q){let M=Y()[Q];M&&I.setState("value",M.getAttribute(la))}function xe(Q){var M;let pe=J(),oe=Y(),fe=oe.findIndex(ze=>ze===pe),Ae=oe[fe+Q];(M=o.current)!=null&&M.loop&&(Ae=fe+Q<0?oe[oe.length-1]:fe+Q===oe.length?oe[0]:oe[fe+Q]),Ae&&I.setState("value",Ae.getAttribute(la))}function Ue(Q){let M=J(),pe=M==null?void 0:M.closest(To),oe;for(;pe&&!oe;)pe=Q>0?Zie(pe,To):Yie(pe,To),oe=pe==null?void 0:pe.querySelector(i3);oe?I.setState("value",oe.getAttribute(la)):xe(Q)}let He=()=>de(Y().length-1),L=Q=>{Q.preventDefault(),Q.metaKey?He():Q.altKey?Ue(1):xe(1)},Re=Q=>{Q.preventDefault(),Q.metaKey?de(0):Q.altKey?Ue(-1):xe(-1)};return k.createElement(Ki.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:Q=>{var M;(M=E.onKeyDown)==null||M.call(E,Q);let pe=Q.nativeEvent.isComposing||Q.keyCode===229;if(!(Q.defaultPrevented||pe))switch(Q.key){case"n":case"j":{y&&Q.ctrlKey&&L(Q);break}case"ArrowDown":{L(Q);break}case"p":case"k":{y&&Q.ctrlKey&&Re(Q);break}case"ArrowUp":{Re(Q);break}case"Home":{Q.preventDefault(),de(0);break}case"End":{Q.preventDefault(),He();break}case"Enter":{Q.preventDefault();let oe=J();if(oe){let fe=new Event(mm);oe.dispatchEvent(fe)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Qie},l),V0(e,Q=>k.createElement(Pw.Provider,{value:I},k.createElement(Rw.Provider,{value:N},Q))))}),$ie=k.forwardRef((e,t)=>{var r,n;let i=Ta(),s=k.useRef(null),a=k.useContext(Ow),o=Vl(),l=Dw(e),u=(n=(r=l.current)==null?void 0:r.forceMount)!=null?n:a==null?void 0:a.forceMount;Ds(()=>{if(!u)return o.item(i,a==null?void 0:a.id)},[u]);let c=Mw(i,s,[e.value,e.children,s],e.keywords),d=$1(),h=Hi(S=>S.value&&S.value===c.current),f=Hi(S=>u||o.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);k.useEffect(()=>{let S=s.current;if(!(!S||e.disabled))return S.addEventListener(mm,m),()=>S.removeEventListener(mm,m)},[f,e.onSelect,e.disabled]);function m(){var S,I;b(),(I=(S=l.current).onSelect)==null||I.call(S,c.current)}function b(){d.setState("value",c.current,!0)}if(!f)return null;let{disabled:y,value:E,onSelect:w,forceMount:x,keywords:_,...A}=e;return k.createElement(Ki.div,{ref:Ns(s,t),...A,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||o.getDisablePointerSelection()?void 0:b,onClick:y?void 0:m},e.children)}),jie=k.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...s}=e,a=Ta(),o=k.useRef(null),l=k.useRef(null),u=Ta(),c=Vl(),d=Hi(f=>i||c.filter()===!1?!0:f.search?f.filtered.groups.has(a):!0);Ds(()=>c.group(a),[]),Mw(a,o,[e.value,e.heading,l]);let h=k.useMemo(()=>({id:a,forceMount:i}),[i]);return k.createElement(Ki.div,{ref:Ns(o,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&k.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),V0(e,f=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},k.createElement(Ow.Provider,{value:h},f))))}),Uie=k.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=k.useRef(null),s=Hi(a=>!a.search);return!r&&!s?null:k.createElement(Ki.div,{ref:Ns(i,t),...n,"cmdk-separator":"",role:"separator"})}),Hie=k.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,s=$1(),a=Hi(u=>u.search),o=Hi(u=>u.selectedItemId),l=Vl();return k.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),k.createElement(Ki.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:i?e.value:a,onChange:u=>{i||s.setState("search",u.target.value),r==null||r(u.target.value)}})}),Vie=k.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,s=k.useRef(null),a=k.useRef(null),o=Hi(u=>u.selectedItemId),l=Vl();return k.useEffect(()=>{if(a.current&&s.current){let u=a.current,c=s.current,d,h=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let f=u.offsetHeight;c.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(d),h.unobserve(u)}}},[]),k.createElement(Ki.div,{ref:Ns(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":n,id:l.listId},V0(e,u=>k.createElement("div",{ref:Ns(a,l.listInnerRef),"cmdk-list-sizer":""},u)))}),qie=k.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:s,container:a,...o}=e;return k.createElement(Dx,{open:r,onOpenChange:n},k.createElement(Fx,{container:a},k.createElement(zx,{"cmdk-overlay":"",className:i}),k.createElement($x,{"aria-label":e.label,"cmdk-dialog":"",className:s},k.createElement(Lw,{ref:t,...o}))))}),Gie=k.forwardRef((e,t)=>Hi(r=>r.filtered.count===0)?k.createElement(Ki.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Wie=k.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...s}=e;return k.createElement(Ki.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},V0(e,a=>k.createElement("div",{"aria-hidden":!0},a)))}),no=Object.assign(Lw,{List:Vie,Item:$ie,Input:Hie,Group:jie,Separator:Uie,Dialog:qie,Empty:Gie,Loading:Wie});function Zie(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Yie(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Dw(e){let t=k.useRef(e);return Ds(()=>{t.current=e}),t}var Ds=typeof window>"u"?k.useEffect:k.useLayoutEffect;function ua(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function Hi(e){let t=$1(),r=()=>e(t.snapshot());return k.useSyncExternalStore(t.subscribe,r,r)}function Mw(e,t,r,n=[]){let i=k.useRef(),s=Vl();return Ds(()=>{var a;let o=(()=>{var u;for(let c of r){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():i.current}})(),l=n.map(u=>u.trim());s.value(e,o,l),(a=t.current)==null||a.setAttribute(la,o),i.current=o}),i}var Kie=()=>{let[e,t]=k.useState(),r=ua(()=>new Map);return Ds(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function Xie(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function V0({asChild:e,children:t},r){return e&&k.isValidElement(t)?k.cloneElement(Xie(t),{ref:t.ref},r(t.props.children)):r(t)}var Qie={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Jie({className:e,...t}){return v.jsx(no,{"data-slot":"command",className:Ie("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function ese({className:e,...t}){return v.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[v.jsx(uO,{className:"size-4 shrink-0 opacity-50"}),v.jsx(no.Input,{"data-slot":"command-input",className:Ie("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function tse({className:e,...t}){return v.jsx(no.List,{"data-slot":"command-list",className:Ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function rse({...e}){return v.jsx(no.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function nse({className:e,...t}){return v.jsx(no.Group,{"data-slot":"command-group",className:Ie("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function ise({className:e,...t}){return v.jsx(no.Item,{"data-slot":"command-item",className:Ie("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function sse({...e}){return v.jsx(Dx,{"data-slot":"dialog",...e})}function ase({...e}){return v.jsx(cD,{"data-slot":"dialog-trigger",...e})}function ose({...e}){return v.jsx(Fx,{"data-slot":"dialog-portal",...e})}function lse({className:e,...t}){return v.jsx(zx,{"data-slot":"dialog-overlay",className:Ie("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function use({className:e,children:t,showCloseButton:r=!0,...n}){return v.jsxs(ose,{"data-slot":"dialog-portal",children:[v.jsx(lse,{}),v.jsxs($x,{"data-slot":"dialog-content",className:Ie("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...n,children:[t,r&&v.jsxs(yD,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx($5,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function cse({className:e,...t}){return v.jsx(gD,{"data-slot":"dialog-title",className:Ie("text-lg leading-none font-semibold",e),...t})}const Bw=e=>v.jsx(sse,{...e}),Fw=e=>v.jsx(ase,{...e}),zw=({className:e,children:t,title:r="Model Selector",...n})=>v.jsxs(use,{"aria-describedby":void 0,className:Ie("outline! border-none! p-0 outline-border! outline-solid!",e),...n,children:[v.jsx(cse,{className:"sr-only",children:r}),v.jsx(Jie,{className:"**:data-[slot=command-input-wrapper]:h-auto",children:t})]}),$w=({className:e,...t})=>v.jsx(ese,{className:Ie("h-auto py-3.5",e),...t}),jw=e=>v.jsx(tse,{...e}),Uw=e=>v.jsx(rse,{...e}),pm=e=>v.jsx(nse,{...e}),gm=e=>v.jsx(ise,{...e}),bm=({className:e,...t})=>v.jsx("span",{className:Ie("flex-1 truncate text-left",e),...t});function dse({className:e,...t}){return v.jsx("textarea",{"data-slot":"textarea",className:Ie("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function hse({className:e,...t}){return v.jsx("div",{"data-slot":"input-group",role:"group",className:Ie("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const fse=ap("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function mse({className:e,align:t="inline-start",...r}){return v.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Ie(fse({align:t}),e),onClick:n=>{var i,s;n.target.closest("button")||(s=(i=n.currentTarget.parentElement)==null?void 0:i.querySelector("input"))==null||s.focus()},...r})}const pse=ap("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function gse({className:e,type:t="button",variant:r="ghost",size:n="xs",...i}){return v.jsx(Hr,{type:t,"data-size":n,variant:r,className:Ie(pse({size:n}),e),...i})}function bse({className:e,...t}){return v.jsx(dse,{"data-slot":"input-group-control",className:Ie("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",e),...t})}function yse({className:e,...t}){return v.jsx(oO,{role:"status","aria-label":"Loading",className:Ie("size-4 animate-spin",e),...t})}const vse=({className:e,onSubmit:t,children:r,...n})=>{const i=k.useCallback(s=>{s.preventDefault();const a=s.currentTarget,o=new FormData(a).get("message")||"";a.reset(),t({text:o},s)},[t]);return v.jsx("form",{className:Ie("w-full",e),onSubmit:i,...n,children:v.jsx(hse,{className:"overflow-hidden",children:r})})},xse=({className:e,...t})=>v.jsx("div",{className:Ie("contents",e),...t}),Ese=({onKeyDown:e,className:t,placeholder:r="What would you like to know?",...n})=>{const[i,s]=k.useState(!1),a=k.useCallback(u=>{if(e==null||e(u),u.defaultPrevented||u.key!=="Enter"||u.shiftKey||i||u.nativeEvent.isComposing)return;u.preventDefault();const{form:c}=u.currentTarget,d=c==null?void 0:c.querySelector('button[type="submit"]');d!=null&&d.disabled||c==null||c.requestSubmit()},[e,i]),o=k.useCallback(()=>s(!1),[]),l=k.useCallback(()=>s(!0),[]);return v.jsx(bse,{className:Ie("field-sizing-content max-h-48 min-h-16",t),name:"message",onCompositionEnd:o,onCompositionStart:l,onKeyDown:a,placeholder:r,...n})},_se=({className:e,...t})=>v.jsx(mse,{align:"block-end",className:Ie("justify-between gap-1",e),...t}),Tse=({className:e,...t})=>v.jsx("div",{className:Ie("flex min-w-0 items-center gap-1",e),...t}),wse=({className:e,variant:t="default",size:r="icon-sm",status:n,onStop:i,onClick:s,children:a,...o})=>{const l=n==="submitted"||n==="streaming";let u=v.jsx(sO,{className:"size-4"});n==="submitted"?u=v.jsx(yse,{}):n==="streaming"?u=v.jsx(dO,{className:"size-4"}):n==="error"&&(u=v.jsx($5,{className:"size-4"}));const c=k.useCallback(d=>{if(l&&i){d.preventDefault(),i();return}s==null||s(d)},[l,i,s]);return v.jsx(gse,{"aria-label":l?"Stop":"Submit",className:Ie(e),onClick:c,size:r,type:l&&i?"button":"submit",variant:t,...o,children:a??u})};function Hw({...e}){return v.jsx(jL,{"data-slot":"collapsible",...e})}function Vw({...e}){return v.jsx(HL,{"data-slot":"collapsible-trigger",...e})}function qw({...e}){return v.jsx(VL,{"data-slot":"collapsible-content",...e})}const Gw=k.createContext({});function kse(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Sse=typeof window<"u",s3=Sse?k.useLayoutEffect:k.useEffect,j1=k.createContext(null);function U1(e,t){e.indexOf(t)===-1&&e.push(t)}function $c(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const di=(e,t,r)=>r>t?t:r<e?e:r;let q0=()=>{};const ii={},H1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ww=e=>typeof e=="object"&&e!==null,V1=e=>/^0[^.\s]+$/u.test(e);function Zw(e){let t;return()=>(t===void 0&&(t=e()),t)}const hn=e=>e,ql=(...e)=>e.reduce((t,r)=>n=>r(t(n))),fl=(e,t,r)=>{const n=t-e;return n?(r-e)/n:1};class jc{constructor(){this.subscriptions=[]}add(t){return U1(this.subscriptions,t),()=>this.remove(t)}remove(t){$c(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Wr=e=>e*1e3,Gr=e=>e/1e3,Yw=(e,t)=>t?e*(1e3/t):0,Kw=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ase=1e-7,Cse=12;function Ise(e,t,r,n,i){let s,a,o=0;do a=t+(r-t)/2,s=Kw(a,n,i)-e,s>0?r=a:t=a;while(Math.abs(s)>Ase&&++o<Cse);return a}function Gl(e,t,r,n){if(e===t&&r===n)return hn;const i=s=>Ise(s,0,1,e,r);return s=>s===0||s===1?s:Kw(i(s),t,n)}const Xw=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qw=e=>t=>1-e(1-t),Jw=Gl(.33,1.53,.69,.99),q1=Qw(Jw),ek=Xw(q1),tk=e=>e>=1?1:(e*=2)<1?.5*q1(e):.5*(2-Math.pow(2,-10*(e-1))),G1=e=>1-Math.sin(Math.acos(e)),rk=Qw(G1),nk=Xw(G1),Nse=Gl(.42,0,1,1),Rse=Gl(0,0,.58,1),W1=Gl(.42,0,.58,1),Pse=e=>Array.isArray(e)&&typeof e[0]!="number",ik=e=>Array.isArray(e)&&typeof e[0]=="number",Ose={linear:hn,easeIn:Nse,easeInOut:W1,easeOut:Rse,circIn:G1,circInOut:nk,circOut:rk,backIn:q1,backInOut:ek,backOut:Jw,anticipate:tk},Lse=e=>typeof e=="string",a3=e=>{if(ik(e)){q0(e.length===4);const[t,r,n,i]=e;return Gl(t,r,n,i)}else if(Lse(e))return Ose[e];return e},Dt={delta:0,timestamp:0,isProcessing:!1};let Vu;function Dse(){Vu=void 0}const Xt={now:()=>(Vu===void 0&&Xt.set(Dt.isProcessing||ii.useManualTiming?Dt.timestamp:performance.now()),Vu),set:e=>{Vu=e,queueMicrotask(Dse)}},wa=e=>Math.round(e*1e5)/1e5,sk=e=>t=>typeof t=="string"&&t.startsWith(e),ak=sk("--"),Mse=sk("var(--"),Z1=e=>Mse(e)?Bse.test(e.split("/*")[0].trim()):!1,Bse=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function o3(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const io={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ml={...io,transform:e=>di(0,1,e)},Au={...io,default:1},Y1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Fse(e){return e==null}const zse=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,K1=(e,t)=>r=>!!(typeof r=="string"&&zse.test(r)&&r.startsWith(e)||t&&!Fse(r)&&Object.prototype.hasOwnProperty.call(r,t)),ok=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,s,a,o]=n.match(Y1);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},$se=e=>di(0,255,e),bh={...io,transform:e=>Math.round($se(e))},ps={test:K1("rgb","red"),parse:ok("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+bh.transform(e)+", "+bh.transform(t)+", "+bh.transform(r)+", "+wa(ml.transform(n))+")"};function jse(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const ym={test:K1("#"),parse:jse,transform:ps.transform},Wl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wn=Wl("deg"),Nn=Wl("%"),ve=Wl("px"),Use=Wl("vh"),Hse=Wl("vw"),l3={...Nn,parse:e=>Nn.parse(e)/100,transform:e=>Nn.transform(e*100)},ma={test:K1("hsl","hue"),parse:ok("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Nn.transform(wa(t))+", "+Nn.transform(wa(r))+", "+wa(ml.transform(n))+")"},Mt={test:e=>ps.test(e)||ym.test(e)||ma.test(e),parse:e=>ps.test(e)?ps.parse(e):ma.test(e)?ma.parse(e):ym.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ps.transform(e):ma.transform(e),getAnimatableNone:e=>{const t=Mt.parse(e);return t.alpha=0,Mt.transform(t)}},Vse=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,lk=new RegExp(Y1.source),uk=new RegExp(Vse.source,"i");function qse(e){return isNaN(e)&&typeof e=="string"&&(lk.test(e)||uk.test(e))}const ck="number",dk="color",Gse="var",Wse="var(",u3="${}",Zse=/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 Yse(e){const t=e.toString();return lk.test(t)||uk.test(t)}function pl(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(Zse,l=>(Mt.test(l)?(n.color.push(s),i.push(dk),r.push(Mt.parse(l))):l.startsWith(Wse)?(n.var.push(s),i.push(Gse),r.push(l)):(n.number.push(s),i.push(ck),r.push(parseFloat(l))),++s,u3)).split(u3);return{values:r,split:o,indexes:n,types:i}}function Kse(e){return pl(e).values}function hk({split:e,types:t}){const r=e.length;return n=>{let i="";for(let s=0;s<r;s++)if(i+=e[s],n[s]!==void 0){const a=t[s];a===ck?i+=wa(n[s]):a===dk?i+=Mt.transform(n[s]):i+=n[s]}return i}}function Xse(e){return hk(pl(e))}const Qse=e=>typeof e=="number"?0:Mt.test(e)?Mt.getAnimatableNone(e):e,Jse=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Qse(e);function eae(e){const t=pl(e);return hk(t)(t.values.map((n,i)=>Jse(n,t.split[i])))}const Nr={test:qse,parse:Kse,createTransformer:Xse,getAnimatableNone:eae};function yh(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function tae({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,a=0;if(!t)i=s=a=r;else{const o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;i=yh(l,o,e+1/3),s=yh(l,o,e),a=yh(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}function Uc(e,t){return r=>r>0?t:e}const tt=(e,t,r)=>e+(t-e)*r,vh=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},rae=[ym,ps,ma],nae=e=>rae.find(t=>t.test(e));function c3(e){const t=nae(e);if(!t)return!1;let r=t.parse(e);return t===ma&&(r=tae(r)),r}const d3=(e,t)=>{const r=c3(e),n=c3(t);if(!r||!n)return Uc(e,t);const i={...r};return s=>(i.red=vh(r.red,n.red,s),i.green=vh(r.green,n.green,s),i.blue=vh(r.blue,n.blue,s),i.alpha=tt(r.alpha,n.alpha,s),ps.transform(i))},vm=new Set(["none","hidden"]);function iae(e,t){return vm.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function sae(e,t){return r=>tt(e,t,r)}function X1(e){return typeof e=="number"?sae:typeof e=="string"?Z1(e)?Uc:Mt.test(e)?d3:lae:Array.isArray(e)?fk:typeof e=="object"?Mt.test(e)?d3:aae:Uc}function fk(e,t){const r=[...e],n=r.length,i=e.map((s,a)=>X1(s)(s,t[a]));return s=>{for(let a=0;a<n;a++)r[a]=i[a](s);return r}}function aae(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=X1(e[i])(e[i],t[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}}function oae(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][n[s]],o=e.values[a]??0;r[i]=o,n[s]++}return r}const lae=(e,t)=>{const r=Nr.createTransformer(t),n=pl(e),i=pl(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?vm.has(e)&&!i.values.length||vm.has(t)&&!n.values.length?iae(e,t):ql(fk(oae(n,i),i.values),r):Uc(e,t)},h3=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function uae(e,t){const r=h3.exec(e);if(!r)return;const n=h3.exec(t);if(!n||r[2]!==n[2])return;const i=r[2],s=parseFloat(r[1]),a=parseFloat(n[1]);return o=>wa(tt(s,a,o))+i}function Q1(e,t,r){if(typeof e=="number"&&typeof t=="number"&&typeof r=="number")return tt(e,t,r);if(typeof e=="string"&&typeof t=="string"){const i=uae(e,t);if(i)return i}return X1(e)(e,t)}const Cu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function cae(e){let t=new Set,r=new Set,n=!1,i=!1;const s=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function o(u){s.has(u)&&(r.add(u),e()),u(a)}const l={schedule:(u,c=!1,d=!1)=>{const f=d&&n?t:r;return c&&s.add(u),f.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,n){i=!0;return}n=!0;const c=t;t=r,r=c,t.forEach(o),t.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const dae=40;function mk(e,t,r={delta:0,timestamp:0,isProcessing:!1}){let n=!1,i=!0;const s=()=>n=!0,a=Cu.reduce((x,_)=>(x[_]=cae(s),x),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:h,render:f,postRender:m}=a,b=()=>{const x=ii.useManualTiming,_=x?r.timestamp:performance.now();n=!1,x||(r.delta=i?1e3/60:Math.max(Math.min(_-r.timestamp,dae),1)),r.timestamp=_,r.isProcessing=!0,o.process(r),l.process(r),u.process(r),c.process(r),d.process(r),h.process(r),f.process(r),m.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(b))},y=()=>{n=!0,i=!0,r.isProcessing||e(b)};return{schedule:Cu.reduce((x,_)=>{const A=a[_];return x[_]=(S,I=!1,N=!1)=>(n||y(),A.schedule(S,I,N)),x},{}),cancel:x=>{for(let _=0;_<Cu.length;_++)a[Cu[_]].cancel(x)},state:r,steps:a}}const{schedule:it,cancel:Vi,steps:xh}=mk(typeof requestAnimationFrame<"u"?requestAnimationFrame:hn,!0,Dt),hae=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>it.update(t,r),stop:()=>Vi(t),now:()=>Dt.isProcessing?Dt.timestamp:Xt.now()}},pk=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let s=0;s<i;s++)n+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},J1=2e4;function eg(e,t=50,r=J1,n){let i=0,s=e.next(i);for(;!s.done&&i<r;)i+=t,s=e.next(i);return i>=r?1/0:i}function fae(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(eg(n),J1);return{type:"keyframes",ease:s=>n.next(i*s).value/t,duration:Gr(i)}}const Yt={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},gk=e=>e<0?1/Math.max(1+e,Yt.minDamping):Math.max(1-e,Yt.minDamping);function bk(e,t){if(!(e>1))return 1;const r=Math.sqrt(e*e-1),n=e-r,i=e+r,s=2*r*Math.exp(-t)*(1+t);return yk(a=>i*Math.exp(-n*a)-n*Math.exp(-i*a)-s,a=>Math.exp(-i*a)-Math.exp(-n*a),t)/t}function xm(e,t){return e*Math.sqrt(1-t*t)}const mae=12;function yk(e,t,r){let n=r;for(let i=1;i<mae;i++)n=n-e(n)/t(n);return n}const Eh=.001;function pae({duration:e=Yt.duration,bounce:t=Yt.bounce}){let r,n;const i=gk(t);e=di(Yt.minDuration,Yt.maxDuration,Gr(e)),i<1?(r=u=>{const c=u*i,d=c*e,h=xm(u,i),f=Math.exp(-d);return Eh-c/h*f},n=u=>{const d=u*i*e,h=i*i*u*u*e,f=Math.exp(-d),m=xm(u*u,i);return(-r(u)+Eh>0?-1:1)*-h*f/m}):(r=u=>{const c=Math.exp(-u*e),d=u*e+1;return-Eh+c*d},n=u=>{const c=Math.exp(-u*e),d=-u*(e*e);return c*d});const s=5/e,a=yk(r,n,s),o=a*bk(i,a*e),l=o*o;return{stiffness:l,damping:i*2*Math.sqrt(l),duration:Wr(e)}}const Em=(e,t)=>(t?e>=0:e>0)&&e<1/0;function _h(e,t){if(Em(e,t))return e}function gae(e){const t=_h(e.stiffness),r=_h(e.damping,!0),n=_h(e.mass),i={...e,stiffness:t??Yt.stiffness,damping:r??Yt.damping,mass:n??Yt.mass,isResolvedFromDuration:!1,isTimeDefined:(t??r??n)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){const s=gk(e.bounce||0),a=2*Math.PI/(e.visualDuration*1.2)*bk(s,2*Math.PI/1.2);i.stiffness=a*a,i.damping=2*s*Math.sqrt(i.stiffness)}else Object.assign(i,pae(i)),i.isResolvedFromDuration=!0;(!Em(i.stiffness)||!Em(i.damping,!0))&&(i.stiffness=Yt.stiffness,i.damping=Yt.damping)}return i}function Hc(e=Yt.visualDuration,t=Yt.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,n=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:n},{stiffness:a,damping:o,mass:l,duration:u,isResolvedFromDuration:c,isTimeDefined:d}=gae({...r}),h=I=>d?0:-Gr(I),f=o/(2*Math.sqrt(a*l)),m=Gr(Math.sqrt(a/l)),b=f*m,y={target:i,delta:i-n,velocity:h(r.velocity||0)||0,restSpeed:0,restDelta:0},E=()=>{const I=Math.abs(y.delta)<5;y.restSpeed=r.restSpeed||(I?Yt.restSpeed.granular:Yt.restSpeed.default),y.restDelta=r.restDelta||(I?Yt.restDelta.granular:Yt.restDelta.default)};E();let w,x,_;if(f<1){const I=xm(m,f),N={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};_=()=>{N.A=(y.velocity+b*y.delta)/I,N.sinC=b*N.A+y.delta*I,N.cosC=b*y.delta-N.A*I};const U=z=>{z!==N.t&&(N.t=z,N.env=Math.exp(-b*z),N.sin=Math.sin(I*z),N.cos=Math.cos(I*z))};w=z=>(U(z),y.target-N.env*(N.A*N.sin+y.delta*N.cos)),x=z=>(U(z),N.env*(N.sinC*N.sin+N.cosC*N.cos))}else if(f===1){w=N=>y.target-Math.exp(-m*N)*(y.delta+(y.velocity+m*y.delta)*N);const I={C:0};_=()=>{I.C=y.velocity+m*y.delta},x=N=>Math.exp(-m*N)*(m*I.C*N-y.velocity)}else{const I=m*Math.sqrt(f*f-1),N=b-I,U=b+I,z=d?1/0:300/I,Z=(ae,J)=>Math.exp(J>z?-ae*z-b*(J-z):-ae*J),V={S:0,F:0};_=()=>{const ae=(y.velocity+b*y.delta)/I;V.S=(y.delta+ae)/2,V.F=(y.delta-ae)/2},w=ae=>y.target-V.S*Z(N,ae)-V.F*Z(U,ae),x=ae=>N*V.S*Z(N,ae)+U*V.F*Z(U,ae)}_();const A=c&&u||null,S={calculatedDuration:A,retarget:(I,N)=>{y.target=I[I.length-1],y.delta=y.target-I[0],y.velocity=h(N),r.restSpeed&&r.restDelta||E(),S.calculatedDuration=A,s.done=!1,_()},velocity:I=>Wr(x(I)),next:I=>{const N=w(I);if(c)s.done=I>=u;else{const U=Wr(x(I));s.done=Math.abs(U)<=y.restSpeed&&Math.abs(y.target-N)<=y.restDelta}return s.value=s.done?y.target:N,s},toString:()=>{const I=Math.min(eg(S),J1),N=pk(U=>S.next(I*U).value,I,30);return I+"ms "+N},toTransition:()=>{}};return S}Hc.applyToOptions=e=>{const t=fae(e,100,Hc);return e.ease=t.ease,e.duration=Wr(t.duration),e.type="keyframes",e};function _m({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],h={done:!1,value:d},f=I=>I<o||I>l,m=I=>o===void 0?l:l===void 0||Math.abs(o-I)<Math.abs(l-I)?o:l;let b=r*t;const y=d+b,E=a===void 0?y:a(y);E!==y&&(b=E-d);const w=I=>-b*Math.exp(-I/n),x=I=>{const N=w(I);h.done=Math.abs(N)<=u,h.value=h.done?E:E+N};let _,A;const S=I=>{f(h.value)&&(_=I,A=Hc({keyframes:[h.value,m(h.value)],velocity:-w(I)/n*1e3,damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:I=>{let N=!1;return!A&&_===void 0&&(N=!0,x(I),S(I)),_!==void 0&&I>=_?A.next(I-_):(!N&&x(I),h)}}}function bae(e,t,r){const n=[],i=r||ii.mix||Q1,s=e.length-1;for(let a=0;a<s;a++){let o=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||hn:t;o=ql(l,o)}n.push(o)}return n}function yae(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const s=e.length;if(q0(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=bae(t,n,i),l=o.length,u=c=>{if(a&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const h=fl(e[d],e[d+1],c);return o[d](h)};return r?c=>u(di(e[0],e[s-1],c)):u}function vae(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=fl(0,t,n);e.push(tt(r,1,i))}}function xae(e){const t=[0];return vae(t,e.length-1),t}function Eae(e,t){return e.map(r=>r*t)}function _ae(e,t){return e.map(()=>t||W1).splice(0,e.length-1)}function Go({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=Pse(n)?n.map(a3):a3(n)||W1,s={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!r||r.length!==2||r[0]===0&&r[1]===1)){const[l,u]=t,c=l===u?void 0:(ii.mix||Q1)(l,u);return{calculatedDuration:e,next:d=>(s.value=c?c(i(e>0?di(0,1,d/e):1)):u,s.done=d>=e,s)}}const a=Eae(r&&r.length===t.length?r:xae(t),e),o=yae(a,t,{ease:Array.isArray(i)?i:_ae(t,i)});return{calculatedDuration:e,next:l=>(s.value=o(l),s.done=l>=e,s)}}const Tae=5;function wae(e,t,r){const n=Math.max(t-Tae,0);return Yw(r-e(n),t-n)}function kae(e,t,r=0){return t<=0?r:e.velocity?e.velocity(t):wae(n=>e.next(n).value,t,e.next(t).value)}const Sae=e=>e!==null;function G0(e,{repeat:t,repeatType:r="loop"},n,i=1){const s=e.filter(Sae),o=i<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!o||n===void 0?s[o]:n}const Aae={decay:_m,inertia:_m,tween:Go,keyframes:Go,spring:Hc};function vk(e){typeof e.type=="string"&&(e.type=Aae[e.type])}function xk(e,t){return{kind:e,animation:t,timestamp:Xt.now(),frameTimestamp:Dt.timestamp,frameIsProcessing:Dt.isProcessing}}function Ek(e,t,r){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...xk("animation-start",e),options:r?{...t,...r}:t})}catch{}}function Cae(e,t){const r=globalThis.__MOTION_INSPECT__;if(r)try{r({...xk("layout-animation-start",e),node:t})}catch{}}class tg{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var t;this.isResolved=!0,(t=this._resolve)==null||t.call(this)}then(t,r){return this.finished.then(t,r)}}const Iae=e=>e/100;class Vc extends tg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Xt.now()&&this.tick(Xt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause(),Ek(this,this.options)}initAnimation(){const{options:t}=this;vk(t);const{type:r=Go,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:o}=t;const l=r||Go;l!==Go&&typeof o[0]!="number"&&(this.mixKeyframes=ql(Iae,Q1(o[0],o[1])),o=[0,100]);const u=l(o===t.keyframes?t:{...t,keyframes:o});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=eg(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:h,repeatDelay:f,type:m,onUpdate:b,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const E=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?E<0:E>i;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,_=n;if(d){const N=Math.min(this.currentTime,i)/o;let U=Math.floor(N),z=N%1;!z&&N>=1&&(z=1),z===1&&U--,U=Math.min(U,d+1),!!(U%2)&&(h==="reverse"?(z=1-z,f&&(z-=f/o)):h==="mirror"&&(_=a)),x=di(0,1,z)*o}let A;w?(this.delayState.value=c[0],A=this.delayState):A=_.next(x),s&&!w&&(A.value=s(A.value));let{done:S}=A;!w&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return I&&m!==_m&&(A.value=G0(c,this.options,y,this.speed)),b&&b(A.value),I&&this.finish(),A}then(t,r){return this.finished.then(t,r)}get duration(){return Gr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Gr(t)}get time(){return Gr(this.currentTime)}set time(t){t=Wr(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return kae(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(Xt.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Gr(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=hae,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),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(Xt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}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){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}const Nae=new Set(["brightness","contrast","saturate","opacity"]);function Rae(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(Y1)||[];if(!n)return e;const i=r.replace(n,"");let s=Nae.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}const Pae=/\b([a-z-]*)\(.*?\)/gu,Tm={...Nr,getAnimatableNone:e=>{const t=e.match(Pae);return t?t.map(Rae).join(" "):e}},wm={...Nr,getAnimatableNone:e=>{const t=Nr.parse(e);return Nr.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},f3={...io,transform:Math.round},Oae={rotate:Wn,pathRotation:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scale:Au,scaleX:Au,scaleY:Au,scaleZ:Au,skew:Wn,skewX:Wn,skewY:Wn,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:ml,originX:l3,originY:l3,originZ:ve},qc={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,inset:ve,insetBlock:ve,insetBlockStart:ve,insetBlockEnd:ve,insetInline:ve,insetInlineStart:ve,insetInlineEnd:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,paddingBlock:ve,paddingBlockStart:ve,paddingBlockEnd:ve,paddingInline:ve,paddingInlineStart:ve,paddingInlineEnd:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,marginBlock:ve,marginBlockStart:ve,marginBlockEnd:ve,marginInline:ve,marginInlineStart:ve,marginInlineEnd:ve,fontSize:ve,backgroundPositionX:ve,backgroundPositionY:ve,...Oae,zIndex:f3,fillOpacity:ml,strokeOpacity:ml,numOctaves:f3},Lae={...qc,color:Mt,backgroundColor:Mt,outlineColor:Mt,fill:Mt,stroke:Mt,borderColor:Mt,borderTopColor:Mt,borderRightColor:Mt,borderBottomColor:Mt,borderLeftColor:Mt,filter:Tm,WebkitFilter:Tm,mask:wm,WebkitMask:wm},_k=e=>Lae[e],Dae=new Set([Tm,wm]);function rg(e,t){let r=_k(e);return Dae.has(r)||(r=Nr),r.getAnimatableNone?r.getAnimatableNone(t):void 0}function Mae(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gs=e=>e*180/Math.PI,km=e=>{const t=gs(Math.atan2(e[1],e[0]));return Sm(t)},Bae={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:km,rotateZ:km,skewX:e=>gs(Math.atan(e[1])),skewY:e=>gs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sm=e=>(e=e%360,e<0&&(e+=360),e),m3=km,p3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),g3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Fae={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:p3,scaleY:g3,scale:e=>(p3(e)+g3(e))/2,rotateX:e=>Sm(gs(Math.atan2(e[6],e[5]))),rotateY:e=>Sm(gs(Math.atan2(-e[2],e[0]))),rotateZ:m3,rotate:m3,skewX:e=>gs(Math.atan(e[4])),skewY:e=>gs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gl(e){return e.includes("scale")?1:0}function Am(e,t){if(!e||e==="none")return gl(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=Fae,i=r;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Bae,i=o}if(!i)return gl(t);const s=n[t],a=i[1].split(",").map($ae);return typeof s=="function"?s(a):a[s]}const zae=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return Am(r,t)};function $ae(e){return parseFloat(e.trim())}const so=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pi=new Set([...so,"pathRotation"]),b3=e=>e===io||e===ve,jae=new Set(["x","y","z"]),Uae=so.filter(e=>!jae.has(e));function Hae(e){const t=[];return Uae.forEach(r=>{const n=e.getValue(r);if(n!==void 0){const i=n.get(),s=r.startsWith("scale")?1:0;if(i===s)return;t.push([r,i]),n.set(s)}}),t}const Vae=new Set(["bottom","right"]);function y3(e,t,r,n,i,s){const a=parseFloat(e);if(!isNaN(a))return a;const{min:o,max:l}=t()[r],u=l-o;return s==="border-box"?u:u-parseFloat(n)-parseFloat(i)}const ks={width:({width:e,paddingLeft:t="0",paddingRight:r="0",boxSizing:n},i)=>y3(e,i,"x",t,r,n),height:({height:e,paddingTop:t="0",paddingBottom:r="0",boxSizing:n},i)=>y3(e,i,"y",t,r,n),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{const{y:r}=t();return parseFloat(e)+(r.max-r.min)},right:({left:e},t)=>{const{x:r}=t();return parseFloat(e)+(r.max-r.min)},x:({transform:e})=>Am(e,"x"),y:({transform:e})=>Am(e,"y")};ks.translateX=ks.x;ks.translateY=ks.y;const Ss=new Set;let Cm=!1,Im=!1,Nm=!1;function Tk(){if(Im){const e=[],t=new Set,r=new Set;Ss.forEach(i=>{i.needsMeasurement&&(e.push(i),t.add(i.element),Vae.has(i.name)&&r.add(i.element))});const n=new Map;r.forEach(i=>{const s=Hae(i);s.length&&(n.set(i,s),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([a,o])=>{var l;(l=i.getValue(a))==null||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Im=!1,Cm=!1,Ss.forEach(e=>e.complete(Nm)),Ss.clear()}function wk(){Ss.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Im=!0)})}function qae(){Nm=!0,wk(),Tk(),Nm=!1}function Gae(e,t,r){if(typeof e=="string"){if(H1(e)||V1(e))return parseFloat(e);if(!Nr.test(e)&&Nr.test(r))return rg(t,r)}return e??void 0}class ng{constructor(t,r,n,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ss.add(this),Cm||(Cm=!0,it.read(wk),it.resolveKeyframes(Tk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){const o=Gae(n.readValue(r,a),r,a);o!==void 0&&(t[0]=o)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}Mae(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ss.delete(this)}cancel(){this.state==="scheduled"&&(Ss.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Wae=e=>e.startsWith("--");function kk(e,t,r){Wae(t)?e.style.setProperty(t,r):e.style[t]=r}const Zae={};function Sk(e,t){const r=Zw(e);return()=>Zae[t]??r()}const Yae=Sk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ak=Sk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Po=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,v3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Po([0,.65,.55,1]),circOut:Po([.55,0,1,.45]),backIn:Po([.31,.01,.66,-.59]),backOut:Po([.33,1.53,.69,.99])};function Ck(e,t){if(e)return typeof e=="function"?Ak()?pk(e,t):"ease-out":ik(e)?Po(e):Array.isArray(e)?e.map(r=>Ck(r,t)||v3.easeOut):v3[e]}function Kae(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const c={[t]:r};l&&(c.offset=l);const d=Ck(o,i);Array.isArray(d)&&(c.easing=d);const h={delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(c,h)}function Ik(e){return typeof e=="function"&&"applyToOptions"in e}function Xae({type:e,...t}){return Ik(e)&&Ak()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Nk extends tg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,q0(typeof t.type!="string");const u=Xae(t);this.animation=Kae(r,n,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const c=G0(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(c),kk(r,n,c),this.animation.cancel()}l==null||l(),this.notifyFinished()},Ek(this,t,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}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(){var r,n,i;const t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Gr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Gr(t)}get time(){return Gr(Number(this.animation.currentTime)||0)}set time(t){const r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Wr(t),r&&this.animation.pause()}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,onAttach:r,observe:n}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Yae()?(this.animation.timeline=t,r==null||r(this.animation),hn):n(this)}}const Rk={anticipate:tk,backInOut:ek,circInOut:nk};function Qae(e){return e in Rk}function Jae(e){typeof e.ease=="string"&&Qae(e.ease)&&(e.ease=Rk[e.ease])}const Th=10;class eoe extends Nk{constructor(t){Jae(t),vk(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:s,...a}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const o=new Vc({...a,autoplay:!1}),l=Math.max(Th,Xt.now()-this.startTime),u=di(0,Th,l-Th),c=o.sample(l).value,{name:d}=this.options;s&&d&&kk(s,d,c),r.setWithVelocity(o.sample(Math.max(0,l-u)).value,c,u),o.stop()}}const x3=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nr.test(e)||e==="0")&&!e.startsWith("url("));function toe(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function roe(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=x3(i,t),o=x3(s,t);return!a||!o?!1:toe(e)||(r==="spring"||Ik(r))&&n}function Rm(e){e.duration=0,e.type="keyframes"}const Pm=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),noe=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ioe(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&noe.test(e[t]))return!0;return!1}const E3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),soe=Zw(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aoe(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:a,keyframes:o}=e;if(!r||!(Pm.has(r)||E3.has(r)))return!1;const l=(d=t==null?void 0:t.owner)==null?void 0:d.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:c}=t.owner.getProps();return soe()&&(Pm.has(r)||E3.has(r)&&ioe(o))&&(r!=="transform"||!c)&&!u&&!n&&i!=="mirror"&&s!==0&&a!=="inertia"}const ooe=40;class loe extends tg{constructor(t){var l;super(),this.stop=()=>{var u,c;this._animation&&(this._animation.stop(),(u=this.stopTimeline)==null||u.call(this)),(c=this.keyframeResolver)==null||c.cancel()},this.createdAt=Xt.now();const{keyframes:r,name:n,motionValue:i,element:s}=t,a=t;a.autoplay??(a.autoplay=!0),a.delay??(a.delay=0),a.type??(a.type="keyframes"),a.repeat??(a.repeat=0),a.repeatDelay??(a.repeatDelay=0),a.repeatType??(a.repeatType="loop");const o=(s==null?void 0:s.KeyframeResolver)||ng;this.keyframeResolver=new o(r,(u,c,d)=>this.onKeyframesResolved(u,c,a,!d),n,i,s),(l=this.keyframeResolver)==null||l.scheduleResolve()}onKeyframesResolved(t,r,n,i){var y,E;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=Xt.now();let d=!0;roe(t,s,a,o)||(d=!1,(ii.instantAnimations||!l)&&(c==null||c(G0(t,n,r))),t[0]=t[t.length-1],Rm(n),n.repeat=0);const h=i?this.resolvedAt?this.resolvedAt-this.createdAt>ooe?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??(n.startTime=h),n.finalKeyframe=r,n.keyframes=t,n.onComplete=()=>{f==null||f(),this.notifyFinished()};const m=d&&!u&&aoe(n);let b;if(m){n.element=(E=(y=n.motionValue)==null?void 0:y.owner)==null?void 0:E.current;try{b=new eoe(n)}catch{b=new Vc(n)}}else b=new Vc(n);this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this._animation.finished:super.finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),qae()),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(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Pk(e,t,r,n=0,i=1){const s=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),a=e.size,o=(a-1)*n;return typeof r=="function"?r(s,a):i===1?s*n:o-s*n}const _3=30,uoe=e=>!isNaN(parseFloat(e));class coe{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const i=Xt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Xt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uoe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){var n;return t==="change"?this.onChangeSubscribe(r):((n=this.events)[t]||(n[t]=new jc)).add(r)}onChangeSubscribe(t){const{events:r}=this;return!r.change&&!this.changeSubscriber?this.changeSubscriber=t:(r.change||(r.change=new jc,r.change.add(this.changeSubscriber),this.changeSubscriber=void 0),r.change.add(t)),()=>{var n;this.changeSubscriber===t?this.changeSubscriber=void 0:(n=r.change)==null||n.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){it.read(()=>{var t;!this.changeSubscriber&&!((t=this.events.change)!=null&&t.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){var n;const{current:t,changeSubscriber:r}=this;r?r(t):(n=this.events.change)==null||n.notify(t)}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=Xt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_3)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,_3);return Yw(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{var s;this.hasAnimated=!0;let n=!1,i;i=t(()=>{var a;n=!0,(a=this.events.animationComplete)==null||a.notify(),this.animation===i&&this.clearAnimation(),r()}),n||(this.animation=i),(s=this.events.animationStart)==null||s.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Fa(e,t){return new coe(e,t)}function Ok(e,t){if(e!=null&&e.inherit&&t){const{inherit:r,...n}=e;return{...t,...n}}return e}function ig(e,t){const r=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return r!==e?Ok(r,e):r}const doe={type:"spring",stiffness:500,damping:25,restSpeed:10},hoe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),foe={type:"keyframes",duration:.8},moe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},poe=(e,{keyframes:t})=>t.length>2?foe:Pi.has(e)?e.startsWith("scale")?hoe(t[1]):doe:moe,goe=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function boe(e){for(const t in e)if(!goe.has(t))return!0;return!1}const sg=(e,t,r,n={},i,s)=>a=>{const o=ig(n,e)||{},l=o.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Wr(l);const c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};boe(o)||Object.assign(c,poe(e,c)),c.duration&&(c.duration=Wr(c.duration)),c.repeatDelay&&(c.repeatDelay=Wr(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Rm(c),c.delay===0&&(d=!0)),(ii.instantAnimations||ii.skipAnimations||i!=null&&i.shouldSkipAnimations||o.skipAnimations)&&(d=!0,Rm(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,d&&!s&&t.get()!==void 0){const h=G0(c.keyframes,o);if(h!==void 0){it.update(()=>{c.onUpdate(h),c.onComplete()});return}}return o.isSync?new Vc(c):new loe(c)},yoe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function voe(e){const t=yoe.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function Lk(e,t,r=1){const[n,i]=voe(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const a=s.trim();return H1(a)?parseFloat(a):a}return Z1(i)?Lk(i,t,r+1):i}function xoe(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Dk(e,t,r,n){const i=s=>typeof s=="function"?s(r!==void 0?r:e.custom,...xoe(n)):s;return t=i(t),typeof t=="string"&&(t=e.variants&&e.variants[t]),i(t)}function As(e,t,r){return Dk(e.getProps(),t,r,e)}const Mk=(e,t)=>{var r;return t==="exit"?(r=e.presenceContext)==null?void 0:r.custom:void 0},Bk=new Set(["width","height","top","left","right","bottom",...so]),Eoe=e=>Array.isArray(e);function _oe(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Fa(r))}function Toe(e){return Eoe(e)?e[e.length-1]||0:e}function woe(e,t){const r=As(e,t);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const a in s){const o=Toe(s[a]);_oe(e,a,o)}}const Qt=e=>!!(e&&e.getVelocity);function koe(e){return!!(Qt(e)&&e.add)}function Om(e,t){const r=e.getValue("willChange");if(koe(r))return r.add(t);if(!r&&ii.WillChange){const n=new ii.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function ag(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Soe="framerAppearId",Fk="data-"+ag(Soe);function zk(e){return e.props[Fk]}const Aoe=typeof window<"u";function Coe({protectedKeys:e,needsAnimating:t},r){const n=r in e&&!t[r];return t[r]=!1,n}function $k(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var m;let{transition:s,transitionEnd:a,...o}=t;const l=e.getDefaultTransition();s=s?Ok(s,l):l;const u=s==null?void 0:s.reduceMotion,c=s==null?void 0:s.skipAnimations;n&&(s=n);const d=[],h=i&&((m=e.animationState)==null?void 0:m.getState()[i]),f=s==null?void 0:s.path;f&&f.animateVisualElement(e,o,s,r,d);for(const b in o){const y=e.getValue(b,e.latestValues[b]??null),E=o[b];if(E===void 0||h&&Coe(h,b))continue;const w={delay:r,...ig(s||{},b)};c&&(w.skipAnimations=!0);const x=y.get();if(x!==void 0&&!y.isAnimating()&&!Array.isArray(E)&&E===x&&!w.velocity){it.update(()=>y.set(E));continue}let _=!1;if(Aoe&&window.MotionHandoffAnimation){const I=zk(e);if(I){const N=window.MotionHandoffAnimation(I,b,it);N!==null&&(w.startTime=N,_=!0)}}Om(e,b);const A=u??e.shouldReduceMotion;y.start(sg(b,y,E,A&&Bk.has(b)?{type:!1}:w,e,_));const S=y.animation;S&&d.push(S)}if(a){const b=()=>it.update(()=>{a&&woe(e,a)});d.length?Promise.all(d).then(b):b()}return d}function Lm(e,t,r={}){const n=As(e,t,Mk(e,r.type)),i=r.transitionOverride||((n==null?void 0:n.transition)??(e.getDefaultTransition()||{})),s=()=>Promise.all(n?$k(e,n,r):[]),a=(l=0)=>{const{variantChildren:u}=e,{delayChildren:c=0,staggerChildren:d,staggerDirection:h}=i,f=[];return u==null||u.forEach(m=>{m.notify("AnimationStart",t),f.push(Lm(m,t,{...r,delay:l+(typeof c=="function"?0:c)+Pk(u,m,c,d,h)}).then(()=>m.notify("AnimationComplete",t)))}),Promise.all(f)},{when:o}=i;return o?o==="beforeChildren"?s().then(()=>a()):a().then(s):Promise.all([s(),a(r.delay)])}function Ioe(e,t,r={}){return e.notify("AnimationStart",t),(Array.isArray(t)?Promise.all(t.map(i=>Lm(e,i,r))):typeof t=="string"?Lm(e,t,r):Promise.all($k(e,As(e,t,r.custom),r))).then(()=>{e.notify("AnimationComplete",t)})}const Noe={test:e=>e==="auto",parse:e=>e},Roe=e=>t=>t.test(e),Poe=[io,ve,Nn,Wn,Hse,Use,Noe],T3=e=>Poe.find(Roe(e));function Ooe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||V1(e):!0}const Loe=new Set(["auto","none","0"]);function Doe(e,t,r){let n=0,i;for(;n<e.length&&!i;){const s=e[n];typeof s=="string"&&!Loe.has(s)&&Yse(s)&&(i=e[n]),n++}if(i&&r)for(const s of t)e[s]!==i&&(e[s]=rg(r,i))}class Moe extends ng{constructor(t,r,n,i,s){super(t,r,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),Z1(d))){const h=Lk(d,r.current);h!==void 0&&(t[c]=h),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Bk.has(n)||t.length!==2)return;const[i,s]=t;if(typeof i=="number"&&typeof s=="number")return;const a=T3(i),o=T3(s),l=o3(i),u=o3(s);if(l!==u&&ks[n]){this.needsMeasurement=!0;return}if(a!==o)if(b3(a)&&b3(o))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else ks[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||Ooe(t[i]))&&n.push(i);n.length&&Doe(t,n,r)}measure(){const{element:t,name:r}=this;return ks[r](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){var s;const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&((s=this.motionValue)==null||s.jump(i,!1))}measureEndState(){var s,a;const{element:t,unresolvedKeyframes:r}=this;if(!t||!t.current)return;(s=this.motionValue)==null||s.jump(this.measuredOrigin,!1);const n=r.length-1,i=r[n];r[n]=this.measure(),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([o,l])=>{t.getValue(o).set(l)}),this.resolveNoneKeyframes()}}const og=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Boe(e){return Ww(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}function lg(e){return Ww(e)&&"ownerSVGElement"in e}const Dm=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jk(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(n=>n!=null)}const Foe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zoe=so.length;function $oe(e,t,r){let n="",i=!0;for(let a=0;a<zoe;a++){const o=so[a],l=e[o];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(o.startsWith("scale")?1:0);else{const c=parseFloat(l);u=o.startsWith("scale")?c===1:c===0}if(!u||r){const c=Dm(l,qc[o]);if(!u){i=!1;const d=Foe[o]||o;n+=`${d}(${c}) `}r&&(t[o]=c)}}const s=e.pathRotation;return s&&(i=!1,n+=`rotate(${Dm(s,qc.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function ug(e,t,r){const{style:n,vars:i,transformOrigin:s}=e;let a=!1,o=!1;for(const l in t){const u=t[l];if(Pi.has(l)){a=!0;continue}else if(ak(l)){i[l]=u;continue}else{const c=Dm(u,qc[l]);l.startsWith("origin")?(o=!0,s[l]=c):n[l]=c}}if(t.transform||(a||r?n.transform=$oe(t,e.transform,r):n.transform&&(n.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:c=0}=s;n.transformOrigin=`${l} ${u} ${c}`}}const joe={offset:"stroke-dashoffset",array:"stroke-dasharray"},Uoe={offset:"strokeDashoffset",array:"strokeDasharray"};function Hoe(e,t,r=1,n=0,i=!0){e.pathLength=1;const s=i?joe:Uoe;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}const Uk=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Hk(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},l,u,c){if(ug(e,o,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;for(const f of Uk)d[f]!==void 0&&(h[f]=d[f],delete d[f]);(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),n!==void 0&&(d.scale=n),i!==void 0&&Hoe(d,i,s,a,!1)}function Vk({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function Voe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qoe(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function wh(e){return e===void 0||e===1}function Mm({scale:e,scaleX:t,scaleY:r}){return!wh(e)||!wh(t)||!wh(r)}function us(e){return Mm(e)||qk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qk(e){return w3(e.x)||w3(e.y)}function w3(e){return e&&e!=="0%"}function Gc(e,t,r){const n=e-r,i=t*n;return r+i}function k3(e,t,r,n,i){return i!==void 0&&(e=Gc(e,i,n)),Gc(e,r,n)+t}function Bm(e,t=0,r=1,n,i){e.min=k3(e.min,t,r,n,i),e.max=k3(e.max,t,r,n,i)}function Gk(e,{x:t,y:r}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,r.translate,r.scale,r.originPoint)}const S3=.999999999999,A3=1.0000000000001;function Goe(e,t,r,n=!1){var o;const i=r.length;if(!i)return;t.x=t.y=1;let s,a;for(let l=0;l<i;l++){s=r[l],a=s.projectionDelta;const{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Sn(e.x,-s.scroll.offset.x),Sn(e.y,-s.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Gk(e,a)),n&&us(s.latestValues)&&qu(e,s.latestValues,(o=s.layout)==null?void 0:o.layoutBox))}t.x<A3&&t.x>S3&&(t.x=1),t.y<A3&&t.y>S3&&(t.y=1)}function Sn(e,t){e.min+=t,e.max+=t}function C3(e,t,r,n,i=.5){const s=tt(e.min,e.max,i);Bm(e,t,r,s,n)}function I3(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function qu(e,t,r){const n=r??e;C3(e.x,I3(t.x,n.x),t.scaleX,t.scale,t.originX),C3(e.y,I3(t.y,n.y),t.scaleY,t.scale,t.originY)}function Wk(e,t){return Vk(qoe(e.getBoundingClientRect(),t))}function Woe(e,t,r){const n=Wk(e,r),{scroll:i}=t;return i&&(Sn(n.x,i.offset.x),Sn(n.y,i.offset.y)),n}const{schedule:cg}=mk(queueMicrotask,!1),an={x:!1,y:!1};function Zk(){return an.x||an.y}function Zoe(e){return e==="x"||e==="y"?an[e]?null:(an[e]=!0,()=>{an[e]=!1}):an.x||an.y?null:(an.x=an.y=!0,()=>{an.x=an.y=!1})}function Yk(e,t){const r=jk(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function Yoe(e){return!(e.pointerType==="touch"||Zk())}function Koe(e,t,r={}){const[n,i,s]=Yk(e,r);return n.forEach(a=>{let o=!1,l=!1,u;const c=()=>{a.removeEventListener("pointerleave",m)},d=y=>{u&&(u(y),u=void 0),c()},h=y=>{o=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(y))},f=()=>{o=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},m=y=>{if(y.pointerType!=="touch"){if(o){l=!0;return}d(y)}},b=y=>{if(!Yoe(y))return;l=!1;const E=t(a,y);typeof E=="function"&&(u=E,a.addEventListener("pointerleave",m,i))};a.addEventListener("pointerenter",b,i),a.addEventListener("pointerdown",f,i)}),s}const Kk=(e,t)=>t?e===t?!0:Kk(e,t.parentElement):!1,dg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Xoe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Qoe(e){return Xoe.has(e.tagName)||e.isContentEditable===!0}const Joe=new Set(["INPUT","SELECT","TEXTAREA"]);function ele(e){return Joe.has(e.tagName)||e.isContentEditable===!0}const Gu=new WeakSet;function N3(e){return t=>{t.key==="Enter"&&e(t)}}function kh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const tle=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=N3(()=>{if(Gu.has(r))return;kh(r,"down");const i=N3(()=>{kh(r,"up")}),s=()=>kh(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function R3(e){return dg(e)&&!Zk()}const P3=new WeakSet;function rle(e,t,r={}){const[n,i,s]=Yk(e,r),a=o=>{const l=o.currentTarget;if(!R3(o)||P3.has(o))return;Gu.add(l),r.stopPropagation&&P3.add(o);const u=t(l,o),c={...i,capture:!0},d=(m,b)=>{window.removeEventListener("pointerup",h,c),window.removeEventListener("pointercancel",f,c),Gu.has(l)&&Gu.delete(l),R3(m)&&typeof u=="function"&&u(m,{success:b})},h=m=>{d(m,l===window||l===document||r.useGlobalTarget||Kk(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",h,c),window.addEventListener("pointercancel",f,c)};return n.forEach(o=>{(r.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),Boe(o)&&(o.addEventListener("focus",u=>tle(u,i)),!Qoe(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}const Wu=new WeakMap;let _i;const Xk=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:lg(n)&&"getBBox"in n?n.getBBox()[t]:n[r],nle=Xk("inline","width","offsetWidth"),ile=Xk("block","height","offsetHeight");function sle({target:e,borderBoxSize:t}){var r;(r=Wu.get(e))==null||r.forEach(n=>{n(e,{get width(){return nle(e,t)},get height(){return ile(e,t)}})})}function ale(e){e.forEach(sle)}function ole(){typeof ResizeObserver>"u"||(_i=new ResizeObserver(ale))}function lle(e,t){_i||ole();const r=jk(e);return r.forEach(n=>{let i=Wu.get(n);i||(i=new Set,Wu.set(n,i)),i.add(t),_i==null||_i.observe(n)}),()=>{r.forEach(n=>{const i=Wu.get(n);i==null||i.delete(t),i!=null&&i.size||_i==null||_i.unobserve(n)})}}const Zu=new Set;let pa;function ule(){pa=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zu.forEach(t=>t(e))},window.addEventListener("resize",pa)}function cle(e){return Zu.add(e),pa||ule(),()=>{Zu.delete(e),!Zu.size&&typeof pa=="function"&&(window.removeEventListener("resize",pa),pa=void 0)}}function O3(e,t){return typeof e=="function"?cle(e):lle(e,t)}function dle(e){return lg(e)&&e.tagName==="svg"}const L3=e=>typeof e=="number"?e:parseFloat(e),D3=()=>({translate:0,scale:1,origin:0,originPoint:0}),ga=()=>({x:D3(),y:D3()}),M3=()=>({min:0,max:0}),Ot=()=>({x:M3(),y:M3()}),hle=new WeakMap;function W0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function bl(e){return typeof e=="string"||Array.isArray(e)}const hg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],B3=["initial",...hg];function Z0(e){if(W0(e.animate))return!0;for(let t=0;t<B3.length;t++)if(bl(e[B3[t]]))return!0;return!1}function Qk(e){return!!(Z0(e)||e.variants)}function fle(e,t,r){for(const n in t){const i=t[n],s=r[n];if(Qt(i))e.addValue(n,i);else if(Qt(s))e.addValue(n,Fa(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){const a=e.getValue(n);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(n);e.addValue(n,Fa(a!==void 0?a:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const Fm={current:null},Jk={current:!1},mle=typeof window<"u";function ple(){if(Jk.current=!0,!!mle)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Fm.current=e.matches;e.addEventListener("change",t),t()}else Fm.current=!1}const F3=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wc={};function e9(e){Wc=e}function gle(){return Wc}class ble{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ng,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Xt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,it.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=Z0(r),this.isVariantNode=Qk(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(r,{},this);for(const f in h){const m=h[f];u[f]!==void 0&&Qt(m)&&m.set(u[f])}}mount(t){var r,n;if(this.hasBeenMounted)for(const i in this.initialValues)(r=this.values.get(i))==null||r.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];if(this.current=t,hle.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.isVariantNode&&!this.isControllingVariants){let i=this;do i=i.props.inherit!==!1&&i.parent;while(i&&!i.isVariantNode);if(i){const{variantChildren:s}=i;s.add(this),this.removeFromVariantTree=()=>s.delete(this)}}this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Jk.current||ple(),this.shouldReduceMotion=Fm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Vi(this.notifyUpdate),Vi(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];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,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&Pm.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:u,duration:c}=r.accelerate,d=new Nk({element:this.current,name:t,keyframes:o,times:l,ease:u,duration:Wr(c)}),h=a(d);this.valueSubscriptions.set(t,()=>{h(),d.cancel()});return}const n=Pi.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&it.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return!this.current||!t.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Wc){const r=Wc[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ot()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<F3.length;n++){const i=F3[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=t[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=fle(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}addValue(t,r){const n=this.values.get(t);if(r!==n){n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r);const i=r.get();i!==void 0&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){var i;if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Fa(r??((i=this.getDefaultValue)==null?void 0:i.call(this,t)),{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(H1(n)||V1(n))?n=parseFloat(n):typeof n!="number"&&!Nr.test(n)&&Nr.test(r)&&(n=rg(t,r)),this.setBaseTarget(t,Qt(n)?n.get():n)),Qt(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}on(t,r){return this.events[t]||(this.events[t]=new jc),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){cg.render(this.render)}}class t9 extends ble{constructor(){super(...arguments),this.KeyframeResolver=Moe}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){const n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Qt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class Xi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function r9(e,{style:t,vars:r},n,i){const s=e.style;let a;for(a in t)s[a]=t[a];i==null||i.applyProjectionStyles(s,n);for(a in r)s.setProperty(a,r[a])}const yl={};function n9(e,{layout:t,layoutId:r}){return Pi.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!yl[e]||e==="opacity")}function fg(e,t,r){var a;const n=e.style,i=t==null?void 0:t.style,s={};if(!n)return s;for(const o in n)(Qt(n[o])||i&&Qt(i[o])||n9(o,e)||((a=r==null?void 0:r.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=n[o]);return s}function yle(e){return window.getComputedStyle(e)}class vle extends t9{constructor(){super(...arguments),this.type="html",this.renderInstance=r9}mount(t){q0(!!t.style),super.mount(t)}readValueFromInstance(t,r){var n;if(Pi.has(r))return(n=this.projection)!=null&&n.isProjecting?gl(r):zae(t,r);{const i=yle(t),s=(ak(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Wk(t,r)}build(t,r,n){ug(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return fg(t,r,n)}}const i9=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"]),s9=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xle(e,t,r,n){r9(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(i9.has(i)?i:ag(i),t.attrs[i])}function a9(e,t,r){const n=fg(e,t,r);for(const i in e)if(Qt(e[i])||Qt(t[i])){const s=so.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}class Ele extends t9{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,r){return Pi.has(r)?super.getBaseTargetFromProps(t,r)??gl(r):t[r]}getDefaultValue(t){return Pi.has(t)?this.latestValues[t]??gl(t):void 0}readValueFromInstance(t,r){if(Pi.has(r)){const n=_k(r);return n&&n.default||0}if(Uk.includes(r)){const i=getComputedStyle(t)[r];if(typeof i=="string"&&i)return i.trim()}return r=i9.has(r)?r:ag(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return a9(t,r,n)}build(t,r,n){Hk(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){xle(t,r,n,i)}mount(t){this.isSVGTag=s9(t.tagName),super.mount(t)}}function o9(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const _le=[...hg].reverse();function Tle(e){let t=o=>Promise.all(o.map(({animation:l,options:u})=>Ioe(e,l,u))),r=z3(),n=!0,i=!1;function s(o){var w;const{props:l,parent:u,manuallyAnimateOnMount:c}=e,d=n||i,h=[],f=new Set;let m={},b=1/0,y=e;do y=y.props.inherit!==!1&&y.parent;while(y&&!y.isControllingVariants);if(_le.forEach((x,_)=>{var Ue,He;const A=r[x],S=l[x],I=y&&y.props[x],N=S!==void 0?S:bl(I)||I===!1?I:void 0,U=bl(N),z=x===o?A.isActive:null;z===!1&&(b=_);const Z=U&&S===void 0&&!(d&&c);if(A.protectedKeys={...m},!A.isActive&&z===null||!N&&!A.prevProp||W0(N)||typeof N=="boolean")return;if(x==="exit"&&A.isActive&&z!==!0){m={...m,...A.prevResolvedValues};return}const V=wle(A.prevProp,N);let ae=V||U&&(z&&!Z||_>b),J=!1;const Y=Array.isArray(N)?N:[N];let de={};if(z!==!1)for(const L of Y){const{transition:Re,transitionEnd:Q,...M}=As(e,L,Mk(e,x))||{};de={...de,...M,...Q}}const{prevResolvedValues:xe}=A;for(const L in{...xe,...de}){if(L in m)continue;const Re=de[L],Q=xe[L],M=Array.isArray(Re)&&Array.isArray(Q)?!o9(Re,Q)||V:Re!==Q;if(M&&Re==null)f.add(L);else if(M||Re!==void 0&&f.has(L)){ae=!0,f.delete(L)&&(J=!0),A.needsAnimating[L]=!0;const pe=e.getValue(L);pe&&(pe.liveStyle=!1)}else A.protectedKeys[L]=!0}if(A.prevProp=N,A.prevResolvedValues=de,A.isActive&&(m={...m,...de}),ae&&(!(Z&&V)||J))for(const L of Y){const Re={type:x};if(typeof L=="string"&&d&&c&&(u!=null&&u.enteringChildren)){const Q=(He=(Ue=As(u,L))==null?void 0:Ue.transition)==null?void 0:He.delayChildren;Re.delay=Pk(u.enteringChildren,e,Q)}h.push({animation:L,options:Re})}}),f.size){const{initial:x}=l,_={},A=typeof x!="boolean"&&As(e,Array.isArray(x)?x[0]:x,(w=e.presenceContext)==null?void 0:w.custom);A&&A.transition&&(_.transition=A.transition),f.forEach(S=>{const I=e.getValue(S);I&&(I.liveStyle=!0);const N=A&&!Array.isArray(x)?A[S]:void 0,U=e.getBaseTargetFromProps(l,S);_[S]=(N!==void 0?N:U!==void 0&&!Qt(U)?U:e.initialValues[S]===void 0?e.baseTarget[S]:void 0)??null}),h.push({animation:_})}const E=d&&e.blockInitialAnimation||n&&!c&&(l.initial===!1||l.initial===l.animate);return n=i=!1,!E&&h.length?t(h):Promise.resolve()}function a(o,l){var c;if(r[o].isActive===l)return Promise.resolve();(c=e.variantChildren)==null||c.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(o,l)}),r[o].isActive=l;const u=s(o);for(const d in r)r[d].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o=>{t=o(e)},getState:()=>r,reset:()=>{r=z3(),i=!0}}}function wle(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!o9(t,e):!1}function z3(){const e={};for(const t of hg)e[t]={isActive:t==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function zm(e,t){e.min=t.min,e.max=t.max}function sn(e,t){zm(e.x,t.x),zm(e.y,t.y)}function $3(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const l9=1e-4,kle=1-l9,Sle=1+l9,u9=.01,Ale=0-u9,Cle=0+u9;function mr(e){return e.max-e.min}function Ile(e,t,r){return Math.abs(e-t)<=r}function j3(e,t,r,n=.5){e.origin=n,e.originPoint=tt(t.min,t.max,e.origin),e.scale=mr(r)/mr(t),e.translate=tt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=kle&&e.scale<=Sle||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ale&&e.translate<=Cle||isNaN(e.translate))&&(e.translate=0)}function Wo(e,t,r,n){j3(e.x,t.x,r.x,n?n.originX:void 0),j3(e.y,t.y,r.y,n?n.originY:void 0)}function U3(e,t,r,n=0){const i=n?tt(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+mr(t)}function Nle(e,t,r,n){U3(e.x,t.x,r.x,n==null?void 0:n.x),U3(e.y,t.y,r.y,n==null?void 0:n.y)}function H3(e,t,r,n=0){const i=n?tt(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+mr(t)}function Zc(e,t,r,n){H3(e.x,t.x,r.x,n==null?void 0:n.x),H3(e.y,t.y,r.y,n==null?void 0:n.y)}function V3(e,t,r,n,i){return e-=t,e=Gc(e,1/r,n),i!==void 0&&(e=Gc(e,1/i,n)),e}function Rle(e,t=0,r=1,n=.5,i,s=e,a=e){if(Nn.test(t)&&(t=parseFloat(t),t=tt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=tt(s.min,s.max,n);e===s&&(o-=t),e.min=V3(e.min,t,r,o,i),e.max=V3(e.max,t,r,o,i)}function q3(e,t,[r,n,i],s,a){Rle(e,t[r],t[n],t[i],t.scale,s,a)}const Ple=["x","scaleX","originX"],Ole=["y","scaleY","originY"];function G3(e,t,r,n){q3(e.x,t,Ple,r?r.x:void 0,n?n.x:void 0),q3(e.y,t,Ole,r?r.y:void 0,n?n.y:void 0)}function W3(e){return e.translate===0&&e.scale===1}function c9(e){return W3(e.x)&&W3(e.y)}function Z3(e,t){return e.min===t.min&&e.max===t.max}function Lle(e,t){return Z3(e.x,t.x)&&Z3(e.y,t.y)}function Y3(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function d9(e,t){return Y3(e.x,t.x)&&Y3(e.y,t.y)}function K3(e){return mr(e.x)/mr(e.y)}function X3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Tn(e){return[e("x"),e("y")]}function Q3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ve.test(e))e=parseFloat(e);else return e;const r=Q3(e,t.target.x),n=Q3(e,t.target.y);return`${r}% ${n}%`}},Dle={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Nr.parse(e);if(i.length>5)return n;const s=Nr.createTransformer(e),a=typeof i[0]!="number"?1:0,o=r.x.scale*t.x,l=r.y.scale*t.y;i[0+a]/=o,i[1+a]/=l;const u=tt(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}};function Mle(e,t,r){let n="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(r==null?void 0:r.z)||0;if((i||s||a)&&(n=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:u,rotate:c,pathRotation:d,rotateX:h,rotateY:f,skewX:m,skewY:b}=r;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),d&&(n+=`rotate(${d}deg) `),h&&(n+=`rotateX(${h}deg) `),f&&(n+=`rotateY(${f}deg) `),m&&(n+=`skewX(${m}deg) `),b&&(n+=`skewY(${b}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(n+=`scale(${o}, ${l})`),n||"none"}const Ble=og.length,J3=e=>typeof e=="number"||ve.test(e);function Fle(e,t,r,n,i,s){i?(e.opacity=tt(0,r.opacity??1,zle(n)),e.opacityExit=tt(t.opacity??1,0,$le(n))):s&&(e.opacity=tt(t.opacity??1,r.opacity??1,n));for(let a=0;a<Ble;a++){const o=og[a];let l=e6(t,o),u=e6(r,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||J3(l)===J3(u)?(e[o]=Math.max(tt(L3(l),L3(u),n),0),(Nn.test(u)||Nn.test(l))&&(e[o]+="%")):e[o]=u}(t.rotate||r.rotate)&&(e.rotate=tt(t.rotate||0,r.rotate||0,n))}function e6(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const zle=h9(0,.5,rk),$le=h9(.5,.95,hn);function h9(e,t,r){return n=>n<e?0:n>t?1:r(fl(e,t,n))}function jle(e,t,r){const n=Qt(e)?e:Fa(e);return n.start(sg("",n,t,r)),n.animation}function vl(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}const Ule=(e,t)=>e.depth-t.depth;class Hle{constructor(){this.children=[],this.isDirty=!1}add(t){U1(this.children,t),this.isDirty=!0}remove(t){$c(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ule),this.isDirty=!1,this.children.forEach(t)}}function Vle(e,t){const r=Xt.now(),n=({timestamp:i})=>{const s=i-r;s>=t&&(Vi(n),e(s-t))};return it.setup(n,!0),()=>Vi(n)}function Yu(e){return Qt(e)?e.get():e}class qle{constructor(){this.members=[]}add(t){U1(this.members,t);for(let r=this.members.length-1;r>=0;r--){const n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&($c(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if($c(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&((r=i.instance)==null?void 0:r.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,r){var i;const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=n.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,i,s,a;(n=(r=t.options).onExitComplete)==null||n.call(r),(a=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||a.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Gle={borderRadius:{...wo,applyTo:[...og]},borderTopLeftRadius:wo,borderTopRightRadius:wo,borderBottomLeftRadius:wo,borderBottomRightRadius:wo,boxShadow:Dle},Ku={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(yl,{...Gle,...yl});const Sh=["","X","Y","Z"],Wle=1e3;let Zle=0;function Ah(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function f9(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=zk(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",it,!(i||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&f9(n)}function m9({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=Zle++,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.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(Xle),this.nodes.forEach(iue),this.nodes.forEach(sue),this.nodes.forEach(Qle)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hle)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new jc),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=lg(a)&&!dle(a),this.instance=a;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),e){let c,d=0;const h=()=>this.root.updateBlockedByResize=!1;it.read(()=>{d=window.innerWidth}),e(a,()=>{const f=window.innerWidth;f!==d&&(d=f,this.root.updateBlockedByResize=!0,c&&c(),c=Vle(h,250),Ku.hasAnimatedSinceResize&&(Ku.hasAnimatedSinceResize=!1,this.nodes.forEach(n6)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||cue,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=u.getProps(),E=!this.targetLayout||!d9(this.targetLayout,f),w=!d&&h;if(this.options.layoutRoot||this.resumeFrom||w||d&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...ig(m,"layout"),onPlay:b,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(c,w,x.path)}else d||n6(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vi(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(aue),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&f9(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(eue),this.nodes.forEach(t6);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(r6);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(tue),this.nodes.forEach(rue),this.nodes.forEach(nue),this.nodes.forEach(Yle),this.nodes.forEach(Kle)):this.nodes.forEach(r6),this.clearAllSnapshots();const o=Xt.now();Dt.delta=di(0,1e3/60,o-Dt.timestamp),Dt.timestamp=o,Dt.isProcessing=!0,xh.update.process(Dt),xh.preRender.process(Dt),xh.render.process(Dt),Dt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jle),this.sharedNodes.forEach(oue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!mr(this.snapshot.measuredBox.x)&&!mr(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=Ot()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!c9(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||us(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),due(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Ot();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(hue))){const{scroll:c}=this.root;c&&(Sn(o.x,c.offset.x),Sn(o.y,c.offset.y))}return o}removeElementScroll(a){var l;const o=Ot();if(sn(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:h}=c;c!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&sn(o,a),Sn(o.x,d.offset.x),Sn(o.y,d.offset.y))}return o}applyTransform(a,o=!1,l){var c,d;const u=l||Ot();sn(u,a);for(let h=0;h<this.path.length;h++){const f=this.path[h];!o&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(Sn(u.x,-f.scroll.offset.x),Sn(u.y,-f.scroll.offset.y)),us(f.latestValues)&&qu(u,f.latestValues,(c=f.layout)==null?void 0:c.layoutBox)}return us(this.latestValues)&&qu(u,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),u}removeTransform(a){var l;const o=Ot();sn(o,a);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!us(c.latestValues))continue;let d;c.instance&&(Mm(c.latestValues)&&c.updateSnapshot(),d=Ot(),sn(d,c.measurePageBox())),G3(o,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,d)}return us(this.latestValues)&&G3(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==Dt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:d}=this.options;if(!this.layout||!(c||d))return;this.resolvedRelativeTargetAt=Dt.timestamp;const h=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Nle(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):sn(this.target,this.layout.layoutBox),Gk(this.target,this.targetDelta)):sn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Mm(this.parent.latestValues)||qk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ot(),this.relativeTargetOrigin=Ot(),Zc(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),sn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Dt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;sn(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;Goe(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ot());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($3(this.prevProjectionDelta.x,this.projectionDelta.x),$3(this.prevProjectionDelta.y,this.projectionDelta.y)),Wo(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!X3(this.projectionDelta.x,this.prevProjectionDelta.x)||!X3(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ga(),this.projectionDelta=ga(),this.projectionDeltaWithTransform=ga()}setAnimationOrigin(a,o=!1,l){const u=this.snapshot,c=u?u.latestValues:{},d={...this.latestValues},h=ga();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const f=Ot(),m=u?u.source:void 0,b=this.layout?this.layout.source:void 0,y=m!==b,E=this.getStack(),w=!E||E.members.length<=1,x=!!(y&&!w&&this.options.crossfade===!0&&!this.path.some(uue));this.animationProgress=0;let _;const A=l==null?void 0:l.interpolateProjection(a);this.mixTargetDelta=S=>{const I=S/1e3,N=A==null?void 0:A(I);N?(h.x.translate=N.x,h.x.scale=tt(a.x.scale,1,I),h.x.origin=a.x.origin,h.x.originPoint=a.x.originPoint,h.y.translate=N.y,h.y.scale=tt(a.y.scale,1,I),h.y.origin=a.y.origin,h.y.originPoint=a.y.originPoint):(i6(h.x,a.x,I),i6(h.y,a.y,I)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zc(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lue(this.relativeTarget,this.relativeTargetOrigin,f,I),_&&Lle(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=Ot()),sn(_,this.relativeTarget)),y&&(this.animationValues=d,Fle(d,c,this.latestValues,I,x,w)),N&&N.rotate!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=N.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Vi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{Ku.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Fa(0)),this.motionValue.jump(0,!1),this.currentAnimation=jle(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),Cae(this.currentAnimation,this),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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wle),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead(),{targetWithTransforms:o,layout:l,latestValues:u}=a;let{target:c}=a;if(!(!o||!c||!l)){if(this!==a&&this.layout&&l&&p9(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ot();const d=mr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+d;const h=mr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}sn(o,c),qu(o,u),Wo(this.projectionDeltaWithTransform,this.layoutCorrected,o,u)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new qle),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&Ah("z",a,u,this.animationValues);for(let c=0;c<Sh.length;c++)Ah(`rotate${Sh[c]}`,a,u,this.animationValues),Ah(`skew${Sh[c]}`,a,u,this.animationValues);a.render();for(const c in u)a.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Yu(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Yu(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!us(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=Mle(this.projectionDeltaWithTransform,this.treeScale,c);l&&(d=l(c,d)),a.transform=d;const{x:h,y:f}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in yl){if(c[m]===void 0)continue;const{correct:b,applyTo:y,isCSSVariable:E}=yl[m],w=d==="none"?c[m]:b(c[m],u);if(y){const x=y.length;for(let _=0;_<x;_++)a[y[_]]=w}else E?this.options.visualElement.renderState.vars[m]=w:a[m]=w}this.options.layoutId&&(a.pointerEvents=u===this?Yu(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(t6),this.root.sharedNodes.clear()}}}function Yle(e){e.updateLayout()}function Kle(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")Tn(d=>{const h=a?t.measuredBox[d]:t.layoutBox[d],f=mr(h);h.min=n[d].min,h.max=h.min+f});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";zm(a?t.measuredBox[d]:t.layoutBox[d],n[d])}else p9(s,t.layoutBox,n)&&Tn(d=>{const h=a?t.measuredBox[d]:t.layoutBox[d],f=mr(n[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const o=ga();Wo(o,n,t.layoutBox);const l=ga();a?Wo(l,e.applyTransform(i,!0),t.measuredBox):Wo(l,n,t.layoutBox);const u=!c9(o);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const m=e.options.layoutAnchor||void 0,b=Ot();Zc(b,t.layoutBox,h.layoutBox,m);const y=Ot();Zc(y,n,f.layoutBox,m),d9(b,y)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=b,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Xle(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 Qle(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jle(e){e.clearSnapshot()}function t6(e){e.clearMeasurements()}function eue(e){e.isLayoutDirty=!0,e.updateLayout()}function r6(e){e.isLayoutDirty=!1}function tue(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rue(e){var t;e.relativeTarget&&((t=e.relativeParent)!=null&&t.isLayoutDirty)&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function nue(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function n6(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iue(e){e.resolveTargetDelta()}function sue(e){e.calcProjection()}function aue(e){e.resetSkewAndRotation()}function oue(e){e.removeLeadSnapshot()}function i6(e,t,r){e.translate=tt(t.translate,0,r),e.scale=tt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function s6(e,t,r,n){e.min=tt(t.min,r.min,n),e.max=tt(t.max,r.max,n)}function lue(e,t,r,n){s6(e.x,t.x,r.x,n),s6(e.y,t.y,r.y,n)}function uue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const cue={duration:.45,ease:[.4,0,.1,1]},a6=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),o6=a6("applewebkit/")&&!a6("chrome/")?Math.round:hn;function l6(e){e.min=o6(e.min),e.max=o6(e.max)}function due(e){l6(e.x),l6(e.y)}function p9(e,t,r){return e==="position"||e==="preserve-aspect"&&!Ile(K3(t),K3(r),.2)}function hue(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fue=m9({attachResizeListener:(e,t)=>vl(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ch={current:void 0},g9=m9({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ch.current){const e=new fue({});e.mount(window),e.setOptions({layoutScroll:!0}),Ch.current=e}return Ch.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),b9=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function mue(e=!0){const t=k.useContext(j1);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=t,s=k.useId();k.useEffect(()=>{if(e)return i(s)},[e]);const a=k.useCallback(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,a]:[!0]}const y9=k.createContext({strict:!1}),u6={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 c6=!1;function pue(){if(c6)return;const e={};for(const t in u6)e[t]={isEnabled:r=>u6[t].some(n=>!!r[n])};e9(e),c6=!0}function v9(){return pue(),gle()}function gue(e){const t=v9();for(const r in e)t[r]={...t[r],...e[r]};e9(t)}const Y0=k.createContext({});function bue(e,t){if(Z0(e)){const{initial:r,animate:n}=e;return{initial:r===!1||bl(r)?r:void 0,animate:bl(n)?n:void 0}}return e.inherit!==!1?t:{}}function yue(e){const{initial:t,animate:r}=bue(e,k.useContext(Y0));return k.useMemo(()=>({initial:t,animate:r}),[d6(t),d6(r)])}function d6(e){return Array.isArray(e)?e.join(" "):e}const mg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function x9(e,t,r){for(const n in t)!Qt(t[n])&&!n9(n,r)&&(e[n]=t[n])}function vue({transformTemplate:e},t){return k.useMemo(()=>{const r=mg();return ug(r,t,e),Object.assign({},r.vars,r.style)},[t])}function xue(e,t){const r=e.style||{},n={};return x9(n,r,e),Object.assign(n,vue(e,t)),n}function Eue(e,t){const r={},n=xue(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const E9=()=>({...mg(),attrs:{}});function _ue(e,t,r,n){const i=k.useMemo(()=>{const s=E9();return Hk(s,t,s9(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};x9(s,e.style,e),i.style={...s,...i.style}}return i}const Tue=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Yc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Tue.has(e)}function wue(e,t){return e.startsWith("on")?!Yc(e):(t==null?void 0:t(e))??!Yc(e)}function kue(e,t,r,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||Qt(e[s])||(wue(s,n)||r===!0&&Yc(s)||!t&&!Yc(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}const Sue=["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 pg(e){return typeof e!="string"||e.includes("-")?!1:!!(Sue.indexOf(e)>-1||/[A-Z]/u.test(e))}function Aue(e,t,r,{latestValues:n},i,s=!1,a,o){const u=(a??pg(e)?_ue:Eue)(t,n,i,e),c=kue(t,typeof e=="string",s,o),d=e!==k.Fragment?{...c,...u,ref:r}:{},{children:h}=t,f=k.useMemo(()=>Qt(h)?h.get():h,[h]);return k.createElement(e,{...d,children:f})}function Cue({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:Iue(r,n,i,e),renderState:t()}}function Iue(e,t,r,n){const i={},s=n(e,{});for(const h in s)i[h]=Yu(s[h]);let{initial:a,animate:o}=e;const l=Z0(e),u=Qk(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let c=r?r.initial===!1:!1;c=c||a===!1;const d=c?o:a;if(d&&typeof d!="boolean"&&!W0(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const m=Dk(e,h[f]);if(m){const{transitionEnd:b,transition:y,...E}=m;for(const w in E){let x=E[w];if(Array.isArray(x)){const _=c?x.length-1:0;x=x[_]}x!==null&&(i[w]=x)}for(const w in b)i[w]=b[w]}}}return i}const _9=e=>(t,r)=>{const n=k.useContext(Y0),i=k.useContext(j1),s=()=>Cue(e,t,n,i);return r?s():kse(s)},Nue=_9({scrapeMotionValuesFromProps:fg,createRenderState:mg}),Rue=_9({scrapeMotionValuesFromProps:a9,createRenderState:E9}),Pue=Symbol.for("motionComponentSymbol");function Oue(e,t,r){const n=k.useRef(r);k.useInsertionEffect(()=>{n.current=r});const i=k.useRef(null);return k.useCallback(s=>{var o;s&&((o=e.onMount)==null||o.call(e,s)),t&&(s?t.mount(s):t.unmount());const a=n.current;if(typeof a=="function")if(s){const l=a(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s)},[t])}const T9=k.createContext({});function ca(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Lue(e,t,r,n,i,s){var x,_;const{visualElement:a}=k.useContext(Y0),o=k.useContext(y9),l=k.useContext(j1),u=k.useContext(b9),c=u.reducedMotion,d=u.skipAnimations,h=k.useRef(null),f=k.useRef(!1);n=n||o.renderer,!h.current&&n&&(h.current=n(e,{visualState:t,parent:a,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:d,isSVG:s}),f.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,b=k.useContext(T9);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Due(h.current,r,i,b);const y=k.useRef(!1);k.useInsertionEffect(()=>{m&&y.current&&m.update(r,l)});const E=r[Fk],w=k.useRef(!!E&&typeof window<"u"&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,E))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,E)));return s3(()=>{var A;!f.current||!m||((A=m.animationState)==null||A.animateChanges(),m.enteringChildren=void 0)},[]),s3(()=>{f.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),k.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,E)}),w.current=!1),m.enteringChildren=void 0)}),m}function Due(e,t,r,n){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:w9(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&ca(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function w9(e){if(e)return e.options.allowProjection!==!1?e.projection:w9(e.parent)}function Ih(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&gue(n);const s=r?r==="svg":pg(e),a=s?Rue:Nue;function o(u,c){let d;const h={...k.useContext(b9),...u,layoutId:Mue(u)},{isStatic:f,isValidProp:m}=h,b=yue(u),y=a(u,f);if(!f&&typeof window<"u"){Bue();const E=Fue(h);d=E.MeasureLayout,b.visualElement=Lue(e,y,h,i,E.ProjectionNode,s)}return v.jsxs(Y0.Provider,{value:b,children:[d&&b.visualElement?v.jsx(d,{visualElement:b.visualElement,...h}):null,Aue(e,u,Oue(y,b.visualElement,c),y,f,t,s,m)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=k.forwardRef(o);return l[Pue]=e,l}function Mue({layoutId:e}){const t=k.useContext(Gw).id;return t&&e!==void 0?t+"-"+e:e}function Bue(e,t){k.useContext(y9).strict}function Fue(e){const t=v9(),{drag:r,layout:n}=t;if(!r&&!n)return{};const i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function zue(e,t){if(typeof Proxy>"u")return Ih;const r=new Map,n=(s,a)=>Ih(s,a,e,t),i=(s,a)=>n(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?n:(r.has(a)||r.set(a,Ih(a,void 0,e,t)),r.get(a))})}const $ue=(e,t)=>t.isSVG??pg(e)?new Ele(t):new vle(t,{allowProjection:e!==k.Fragment});class jue extends Xi{constructor(t){super(t),t.animationState||(t.animationState=Tle(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();W0(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Uue=0;class Hue extends Xi{constructor(){super(...arguments),this.id=Uue++}update(){var l;const{presenceContext:t,prevPresenceContext:r,animationState:n}=this.node;if(!t||!n)return;const{isPresent:i,onExitComplete:s}=t,a=r==null?void 0:r.isPresent;if(i===a)return;if(i&&a===!1){if(this.exit===!0){const{initial:u}=this.node.getProps();if(u&&!Array.isArray(u)){const{transition:c,transitionEnd:d,...h}=As(this.node,u)||{};for(const f in h)(l=this.node.getValue(f))==null||l.jump(h[f])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive("exit",!1);this.exit=void 0;return}const o=this.exit=n.setActive("exit",!i);s&&!i&&o.then(()=>{this.exit===o&&(this.exit=!0,s(this.id))})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Vue={animation:{Feature:jue},exit:{Feature:Hue}};function K0(e){return{point:{x:e.pageX,y:e.pageY}}}const que=e=>t=>dg(t)&&e(t,K0(t));function Zo(e,t,r,n){return vl(e,t,que(r),n)}const k9=({current:e})=>e?e.ownerDocument.defaultView:null,h6=(e,t)=>Math.abs(e-t);function Gue(e,t){const r=h6(e.x,t.x),n=h6(e.y,t.y);return Math.sqrt(r**2+n**2)}const f6=new Set(["auto","scroll"]);class S9{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Iu(this.lastRawMoveEventInfo,this.transformPagePoint));const m=Nh(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,y=Gue(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!y)return;const{point:E}=m;this.history.push({...E,timestamp:Xt.now()});const{onStart:w,onMove:x}=this.handlers;b||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,m)},this.handlePointerMove=(m,b)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=Iu(b,this.transformPagePoint),this.hasPendingMove=!0,it.update(this.updatePoint,!0)},this.handlePointerUp=(m,b)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:y,onSessionEnd:E,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Nh(m.type==="pointercancel"?this.lastMoveEventInfo:Iu(b,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,x),E&&E(m,x)},!dg(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=i||window;const l=K0(t),u=Iu(l,this.transformPagePoint),{point:c}=u,{timestamp:d}=Dt;this.history=[{...c,timestamp:d}];const{onSessionStart:h}=r;h&&h(t,Nh(u,this.history));const f={passive:!0,capture:!0};this.removeListeners=ql(Zo(this.contextWindow,"pointermove",this.handlePointerMove,f),Zo(this.contextWindow,"pointerup",this.handlePointerUp,f),Zo(this.contextWindow,"pointercancel",this.handlePointerUp,f)),o&&this.startScrollTracking(o)}startScrollTracking(t){let r=t.parentElement;for(;r;){const n=getComputedStyle(r);(f6.has(n.overflowX)||f6.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-r.x,y:i.y-r.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),it.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vi(this.updatePoint)}}function Iu(e,t){return t?{point:t(e.point)}:e}function m6(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nh({point:e},t){return{point:e,delta:m6(e,A9(t)),offset:m6(e,Wue(t)),velocity:Zue(t,.1)}}function Wue(e){return e[0]}function A9(e){return e[e.length-1]}function Zue(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=A9(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>Wr(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>Wr(t)*2&&(n=e[1]);const s=Gr(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Yue(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?tt(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?tt(r,e,n.max):Math.min(e,r)),e}function p6(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Kue(e,{top:t,left:r,bottom:n,right:i}){return{x:p6(e.x,r,i),y:p6(e.y,t,n)}}function g6(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function Xue(e,t){return{x:g6(e.x,t.x),y:g6(e.y,t.y)}}function Que(e,t){let r=.5;const n=mr(e),i=mr(t);return i>n?r=fl(t.min,t.max-n,e.min):n>i&&(r=fl(e.min,e.max-i,t.min)),di(0,1,r)}function Jue(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const $m=.35;function ece(e=$m){return e===!1?e=0:e===!0&&(e=$m),{x:b6(e,"left","right"),y:b6(e,"top","bottom")}}function b6(e,t,r){return{min:y6(e,t),max:y6(e,r)}}function y6(e,t){return typeof e=="number"?e:e[t]||0}const tce=new WeakMap;class rce{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=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{r&&this.snapToCursor(d),this.stopAnimation()},a=(d,h)=>{const{drag:f,dragPropagation:m,onDragStart:b}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zoe(f),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tn(E=>{let w=this.getAxisMotionValue(E).get()||0;if(Nn.test(w)){const{projection:x}=this.visualElement;if(x&&x.layout){const _=x.layout.layoutBox[E];_&&(w=mr(_)*(parseFloat(w)/100))}}this.originPoint[E]=w}),b&&it.update(()=>b(d,h),!1,!0),Om(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h;const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:b,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:E}=h;if(m&&this.currentDirection===null){this.currentDirection=ice(E),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",h.point,E),this.updateAxis("y",h.point,E),this.visualElement.render(),y&&it.update(()=>y(d,h),!1,!0)},l=(d,h)=>{this.latestPointerEvent=d,this.latestPanInfo=h,this.stop(d,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new S9(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:k9(this.visualElement),element:this.visualElement.current})}stop(t,r){const n=t||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&it.postRender(()=>o(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Nu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=Yue(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&ca(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Kue(n.layoutBox,t):this.constraints=!1,this.elastic=ece(r),i!==this.constraints&&!ca(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Tn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Jue(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!ca(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=Woe(n,i.root,this.visualElement.getTransformPagePoint());let a=Xue(i.layout.layoutBox,s);if(r){const o=r(Voe(a));this.hasMutatedConstraints=!!o,o&&(a=Vk(o))}return a}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Tn(c=>{if(!Nu(c,r,this.currentDirection))return;let d=l&&l[c]||{};(a===!0||a===c)&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:n?t[c]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(o)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Om(this.visualElement,t),n.start(sg(t,n,0,r,this.visualElement,!1))}stopAnimation(){Tn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:r}){var o;const{drag:n}=this.getProps(),i={x:t,y:r},s=((o=this.visualElement.getTransformPagePoint())==null?void 0:o(i))||i,a=this.visualElement.measureViewportBox();Tn(l=>{if(!Nu(l,n,this.currentDirection))return;const u=this.getAxisMotionValue(l),{min:c,max:d}=a[l];u.set((u.get()||0)+s[l]-tt(c,d,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!ca(r)||!n||!this.constraints)return;this.stopAnimation();const i=this.constraints,s={x:0,y:0};Tn(o=>{const l=this.getAxisMotionValue(o).get();s[o]=Que({min:l,max:l},i[o])});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tn(o=>{const l=this.getAxisMotionValue(o);if(!Nu(o,t,null)||!l.get())return;const{min:u,max:c}=this.constraints[o];l.set(tt(u,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;tce.set(this.visualElement,this);const t=this.visualElement.current,r=Zo(t,"pointerdown",u=>{const{drag:c,dragListener:d=!0}=this.getProps(),h=u.target,f=h!==t&&ele(h);c&&d&&!f&&this.start(u)});let n;const i=()=>{const{dragConstraints:u}=this.getProps();ca(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=nce(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),it.read(i);const o=vl(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Tn(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=u[d].translate,h.set(h.get()+u[d].translate))}),this.visualElement.render())}));return()=>{o(),r(),a(),l&&l(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=$m,dragMomentum:o=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function v6(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function nce(e,t,r){const n=O3(e,v6(r)),i=O3(t,v6(r));return()=>{n(),i()}}function Nu(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function ice(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class sce extends Xi{constructor(t){super(t),this.removeGroupControls=hn,this.removeListeners=hn,this.controls=new rce(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||hn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Rh=e=>(t,r)=>{e&&it.update(()=>e(t,r),!1,!0)};class ace extends Xi{constructor(){super(...arguments),this.removePointerDownListener=hn}onPointerDown(t){this.session=new S9(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:k9(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Rh(t),onStart:Rh(r),onMove:Rh(n),onEnd:(s,a)=>{delete this.session,i&&it.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Zo(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 Ph=!1;class oce extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),Ph&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ku.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,{projection:a}=n;return a&&(a.isPresent=s,t.layoutDependency!==r&&a.setOptions({...a.options,layoutDependency:r}),Ph=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||it.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:r}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=r,n.root.didUpdate(),cg.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;Ph=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function C9(e){const[t,r]=mue(),n=k.useContext(Gw);return v.jsx(oce,{...e,layoutGroup:n,switchLayoutGroup:k.useContext(T9),isPresent:t,safeToRemove:r})}const lce={pan:{Feature:ace},drag:{Feature:sce,ProjectionNode:g9,MeasureLayout:C9}};function x6(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,s=n[i];s&&it.postRender(()=>s(t,K0(t)))}class uce extends Xi{mount(){const{current:t}=this.node;t&&(this.unmount=Koe(t,(r,n)=>(x6(this.node,n,"Start"),i=>x6(this.node,i,"End"))))}unmount(){}}class cce extends Xi{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=ql(vl(this.node.current,"focus",()=>this.onFocus()),vl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function E6(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),s=n[i];s&&it.postRender(()=>s(t,K0(t)))}class dce extends Xi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=rle(t,(i,s)=>(E6(this.node,s,"Start"),(a,{success:o})=>E6(this.node,a,o?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const jm=new WeakMap,Oh=new WeakMap,hce=e=>{const t=jm.get(e.target);t&&t(e)},fce=e=>{e.forEach(hce)};function mce({root:e,...t}){const r=e||document;Oh.has(r)||Oh.set(r,{});const n=Oh.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(fce,{root:e,...t})),n[i]}function pce(e,t,r){const n=mce(t);return jm.set(e,r),n.observe(e),()=>{jm.delete(e),n.unobserve(e)}}const gce={some:0,all:1};class bce extends Xi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=t,a={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:gce[i]},o=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),f=c?d:h;f&&f(u)};this.stopObserver=pce(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(yce(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function yce({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const vce={inView:{Feature:bce},tap:{Feature:dce},focus:{Feature:cce},hover:{Feature:uce}},xce={layout:{ProjectionNode:g9,MeasureLayout:C9}},Ece={...Vue,...vce,...lce,...xce},_ce=zue(Ece,$ue),Tce=_ce,_6=new Map,wce=e=>{let t=_6.get(e);return t||(t=Tce.create(e),_6.set(e,t)),t},kce=({children:e,as:t="p",className:r,duration:n=2,spread:i=2})=>{const s=wce(t),a=k.useMemo(()=>((e==null?void 0:e.length)??0)*i,[e,i]);return v.jsx(s,{animate:{backgroundPosition:"0% center"},className:Ie("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",r),initial:{backgroundPosition:"100% center"},style:{"--spread":`${a}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{duration:n,ease:"linear",repeat:Number.POSITIVE_INFINITY},children:e})},Sce=k.memo(kce),I9=k.createContext(null),Ace=()=>{const e=k.useContext(I9);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Cce=1e3,Ice=1e3,N9=k.memo(({className:e,isStreaming:t=!1,open:r,defaultOpen:n,onOpenChange:i,duration:s,children:a,...o})=>{const l=n??t,u=n===!1,[c,d]=Jo({defaultProp:l,onChange:i,prop:r}),[h,f]=Jo({defaultProp:void 0,prop:s}),m=k.useRef(t),[b,y]=k.useState(!1),E=k.useRef(null);k.useEffect(()=>{t?(m.current=!0,E.current===null&&(E.current=Date.now())):E.current!==null&&(f(Math.ceil((Date.now()-E.current)/Ice)),E.current=null)},[t,f]),k.useEffect(()=>{t&&!c&&!u&&d(!0)},[t,c,d,u]),k.useEffect(()=>{if(m.current&&!t&&c&&!b){const _=setTimeout(()=>{d(!1),y(!0)},Cce);return()=>clearTimeout(_)}},[t,c,d,b]);const w=k.useCallback(_=>{d(_)},[d]),x=k.useMemo(()=>({duration:h,isOpen:c,isStreaming:t,setIsOpen:d}),[h,c,t,d]);return v.jsx(I9.Provider,{value:x,children:v.jsx(Hw,{className:Ie("not-prose mb-4",e),onOpenChange:w,open:c,...o,children:a})})}),Nce=(e,t)=>e||t===0?v.jsx(Sce,{duration:1,children:"Thinking..."}):t===void 0?v.jsx("p",{children:"Thought for a few seconds"}):v.jsxs("p",{children:["Thought for ",t," seconds"]}),R9=k.memo(({className:e,children:t,getThinkingMessage:r=Nce,...n})=>{const{isStreaming:i,isOpen:s,duration:a}=Ace();return v.jsx(Vw,{className:Ie("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...n,children:t??v.jsxs(v.Fragment,{children:[v.jsx(nO,{className:"size-4"}),r(i,a),v.jsx(E5,{className:Ie("size-4 transition-transform",s?"rotate-180":"rotate-0")})]})})}),P9=k.memo(({className:e,children:t,...r})=>v.jsx(qw,{className:Ie("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...r,children:v.jsx(z1,{plugins:xw,rehypePlugins:Ew,children:t})}));N9.displayName="Reasoning";R9.displayName="ReasoningTrigger";P9.displayName="ReasoningContent";const Rce=({suggestion:e,onClick:t,className:r,variant:n="outline",size:i="sm",children:s,...a})=>{const o=k.useCallback(()=>{t==null||t(e)},[t,e]);return v.jsx(Hr,{className:Ie("cursor-pointer rounded-full px-4",r),onClick:o,size:i,type:"button",variant:n,...a,children:s||e})},Pce=e=>e&&e&1,Oce=e=>e&&e&2,Lce=e=>e&&e&4,Dce=e=>e.map((t,r)=>({key:`line-${r}`,tokens:t.map((n,i)=>({key:`line-${r}-${i}`,token:n}))})),Mce=({token:e})=>v.jsx("span",{className:"dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]",style:{backgroundColor:e.bgColor,color:e.color,fontStyle:Pce(e.fontStyle)?"italic":void 0,fontWeight:Oce(e.fontStyle)?"bold":void 0,textDecoration:Lce(e.fontStyle)?"underline":void 0,...e.htmlStyle},children:e.content}),Bce=Ie("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-8","before:mr-4","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Fce=({keyedLine:e,showLineNumbers:t})=>v.jsx("span",{className:t?Bce:"block",children:e.tokens.length===0?`
792
792
  `:e.tokens.map(({token:r,key:n})=>v.jsx(Mce,{token:r},n))}),T6=new Map,w6=new Map,na=new Map,zce=(e,t)=>{const r=e.slice(0,100),n=e.length>100?e.slice(-100):"";return`${t}:${e.length}:${r}:${n}`},$ce=e=>{const t=T6.get(e);if(t)return t;const r=BE({langs:[e],themes:["github-light","github-dark"]});return T6.set(e,r),r},jce=e=>({bg:"transparent",fg:"inherit",tokens:e.split(`
793
- `).map(t=>t===""?[]:[{color:"inherit",content:t}])}),k6=(e,t,r)=>{var s;const n=zce(e,t),i=w6.get(n);return i||(r&&(na.has(n)||na.set(n,new Set),(s=na.get(n))==null||s.add(r)),$ce(t).then(a=>{const l=a.getLoadedLanguages().includes(t)?t:"text",u=a.codeToTokens(e,{lang:l,themes:{dark:"github-dark",light:"github-light"}}),c={bg:u.bg??"transparent",fg:u.fg??"inherit",tokens:u.tokens};w6.set(n,c);const d=na.get(n);if(d){for(const h of d)h(c);na.delete(n)}}).catch(a=>{console.error("Failed to highlight code:",a),na.delete(n)}),null)},O9=k.memo(({tokenized:e,showLineNumbers:t,className:r})=>{const n=k.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=k.useMemo(()=>Dce(e.tokens),[e.tokens]);return v.jsx("pre",{className:Ie("dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",r),style:n,children:v.jsx("code",{className:Ie("font-mono text-sm",t&&"[counter-increment:line_0] [counter-reset:line]"),children:i.map(s=>v.jsx(Fce,{keyedLine:s,showLineNumbers:t},s.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);O9.displayName="CodeBlockBody";const Uce=({className:e,language:t,style:r,...n})=>v.jsx("div",{className:Ie("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",e),"data-language":t,style:{containIntrinsicSize:"auto 200px",contentVisibility:"auto",...r},...n}),Hce=({code:e,language:t,showLineNumbers:r=!1})=>{const n=k.useMemo(()=>jce(e),[e]),i=k.useMemo(()=>k6(e,t)??n,[e,t,n]),[s,a]=k.useState(null),o=k.useRef({code:e,language:t});(o.current.code!==e||o.current.language!==t)&&(o.current={code:e,language:t},a(null)),k.useEffect(()=>{let u=!1;return k6(e,t,c=>{u||a(c)}),()=>{u=!0}},[e,t]);const l=s??i;return v.jsx("div",{className:"relative overflow-auto",children:v.jsx(O9,{showLineNumbers:r,tokenized:l})})},Um=({code:e,language:t,showLineNumbers:r=!1,className:n,children:i,...s})=>v.jsxs(Uce,{className:n,language:t,...s,children:[i,v.jsx(Hce,{code:e,language:t,showLineNumbers:r})]}),Vce=({className:e,...t})=>v.jsx(Hw,{className:Ie("group not-prose mb-4 w-full rounded-md border",e),...t}),qce={"approval-requested":"Awaiting Approval","approval-responded":"Responded","input-available":"Running","input-streaming":"Pending","output-available":"Completed","output-denied":"Denied","output-error":"Error"},Gce={"approval-requested":v.jsx(rb,{className:"size-3 text-muted-foreground"}),"approval-responded":v.jsx(eb,{className:"size-3 text-muted-foreground"}),"input-available":v.jsx(rb,{className:"size-3 animate-pulse"}),"input-streaming":v.jsx(iO,{className:"size-3"}),"output-available":v.jsx(eb,{className:"size-3 text-green-600"}),"output-denied":v.jsx(tb,{className:"size-3 text-orange-600"}),"output-error":v.jsx(tb,{className:"size-3 text-red-600"})},Wce=e=>v.jsxs(W9,{children:[Gce[e],qce[e]]}),S6=({className:e,title:t,type:r,state:n,toolName:i,...s})=>{const a=r==="dynamic-tool"?i:r.split("-").slice(1).join("-");return v.jsxs(Vw,{className:Ie("flex w-full items-center justify-between gap-4 p-3",e),...s,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(fO,{className:"size-4 text-muted-foreground"}),v.jsx("span",{className:"font-medium text-sm",children:t??a}),Wce(n)]}),v.jsx(E5,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})},Zce=({className:e,...t})=>v.jsx(qw,{className:Ie("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Yce=({className:e,input:t,...r})=>v.jsxs("div",{className:Ie("space-y-2 overflow-hidden",e),...r,children:[v.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),v.jsx("div",{className:"rounded-md bg-muted/50",children:v.jsx(Um,{code:JSON.stringify(t,null,2),language:"json"})})]}),Kce=({className:e,output:t,errorText:r,...n})=>{if(!(t||r))return null;let i=v.jsx("div",{children:t});return typeof t=="object"&&!k.isValidElement(t)?i=v.jsx(Um,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(i=v.jsx(Um,{code:t,language:"json"})),v.jsxs("div",{className:Ie("space-y-2",e),...n,children:[v.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:r?"Error":"Result"}),v.jsxs("div",{className:Ie("overflow-x-auto rounded-md text-xs [&_table]:w-full",r?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[r&&v.jsx("div",{children:r}),i]})]})},L9="antseed-console-chat";function Yo(e,t){try{const r=localStorage.getItem(`${L9}:${e}`);return r?JSON.parse(r):t}catch{return t}}function Ko(e,t){try{localStorage.setItem(`${L9}:${e}`,JSON.stringify(t))}catch{}}function A6(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function C6(e){return e===null?"?":`$${e<.01?e.toFixed(3):e.toFixed(2)}`}function D9(e){return e===null?"cost unknown":`≈ ${Lh(e??0)}`}function Xce(){const e=k.useRef(null);return k.useLayoutEffect(()=>{const t=e.current;if(!t)return;const r=()=>{const i=t.getBoundingClientRect().top+window.scrollY,s=t.closest("main"),a=s&&parseFloat(getComputedStyle(s).paddingBottom)||0,o=`${Math.max(window.innerWidth<=640?320:448,window.innerHeight-i-a)}px`;t.style.height!==o&&(t.style.height=o)};r();const n=new ResizeObserver(r);return n.observe(document.body),window.addEventListener("resize",r),()=>{n.disconnect(),window.removeEventListener("resize",r)}},[]),e}function Qce({apiKey:e,workspaceName:t,chatCost:r}){var s;if(!e)return v.jsxs("span",{children:["Paid by ",t,"."]});const n=[e.limits.monthly,((s=e.ownerLimits)==null?void 0:s.monthly)??null].filter(a=>a!==null),i=n.length?n.reduce((a,o)=>Number(o)<Number(a)?o:a):null;return v.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-1.5 gap-y-0.5",children:[v.jsx(aO,{className:"size-3.5"}),v.jsxs("span",{children:["Paid by ",t," with key"]}),v.jsxs("a",{className:"font-medium text-foreground underline-offset-2 hover:underline",href:Zm("keys"),onClick:Wm("keys"),title:`Key ${e.id}`,children:[e.label," ",v.jsxs("span",{className:"font-mono text-muted-foreground",children:["…",e.hint]})]}),v.jsxs("span",{children:["· ",Lh(e.usage.spentThisMonth)," this month",i?` of ${Lh(i)}`:""]}),r!==0&&v.jsxs("span",{children:["· this chat ",D9(r)]})]})}function za(e){return e.name?`${e.name} (${Aa(e.peerId)})`:Aa(e.peerId)}function Jce(e){var r;const t=e.trim().split(/\s+/).filter(Boolean);return((((r=t[0])==null?void 0:r[0])??"?")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()}function Ar({tone:e="neutral",children:t,title:r}){const n={free:"border-success/30 bg-success/10 text-success",tee:"border-info/30 bg-info/10 text-info",neutral:"border-border text-muted-foreground"};return v.jsx("span",{title:r,className:`inline-flex items-center rounded border px-1.5 py-px font-medium text-[10px] leading-4 ${n[e]}`,children:t})}function Kc(e){let t=0;for(const r of e)t=(t*31+r.charCodeAt(0))%360;return`hsl(${t} 65% 55%)`}function Hm({offer:e}){return wl(e)?v.jsx(Ar,{tone:"free",children:"Free"}):v.jsx("span",{className:"text-muted-foreground text-xs",children:Vm(e)})}function e0e({message:e,streaming:t,initials:r}){var a;if(e.role==="user")return v.jsxs("div",{className:"flex items-center justify-end gap-1.5 text-xs",children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:"You"}),v.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-foreground font-semibold text-[9px] text-background",children:r})]});const n=e.metadata;if(!n)return null;const i=n.peers,s=n.costUsd===0&&(((a=n.usage)==null?void 0:a.outputTokens)??0)>0;return v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-xs","aria-live":"polite",children:[i.length===0?v.jsx("span",{className:"text-muted-foreground",children:t?n.pinnedPeerId?`Waiting for ${Aa(n.pinnedPeerId)}…`:"Choosing a seller…":"No seller answered"}):i.map((o,l)=>v.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l>0&&v.jsx("span",{className:"text-muted-foreground",children:"then"}),v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(o.peerId)},"aria-hidden":"true"}),v.jsx("span",{className:"font-medium text-foreground",title:o.peerId,children:za(o)})]},`${o.peerId}-${l}`)),v.jsx(Ar,{children:n.model}),n.pinnedPeerId&&v.jsx(Ar,{children:"Pinned"}),s&&v.jsx(Ar,{tone:"free",children:"Free"})]})}function t0e({metadata:e}){const t=e==null?void 0:e.usage;return!t||t.inputTokens===0&&t.outputTokens===0?null:v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-muted-foreground text-xs",children:[v.jsx(cO,{className:"size-3.5"}),v.jsxs("span",{children:[vg(t.inputTokens)," in / ",vg(t.outputTokens)," out tokens"]}),v.jsx("span",{children:"·"}),e.costUsd===0?v.jsx(Ar,{tone:"free",children:"Free"}):v.jsx("span",{className:"font-medium text-foreground",title:"At the serving seller's advertised prices; the signed amount is in Logs.",children:D9(e.costUsd)})]})}function M9({filters:e,active:t,onToggle:r,sorts:n,sort:i,onSort:s,count:a}){return v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b px-3 py-2",children:[e.map(o=>v.jsxs(Hr,{type:"button",size:"xs",variant:t.has(o.id)?"secondary":"ghost","aria-pressed":t.has(o.id),className:t.has(o.id)?"border border-foreground/30":"border border-transparent text-muted-foreground",onClick:()=>r(o.id),children:[t.has(o.id)&&v.jsx(ac,{}),o.label]},o.id)),v.jsx("span",{className:"ml-auto text-muted-foreground text-xs",children:a}),v.jsxs("label",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:["Sort",v.jsx("select",{className:"rounded-md border bg-transparent px-1.5 py-0.5 text-foreground text-xs",value:i,onChange:o=>s(o.target.value),children:n.map(o=>v.jsx("option",{value:o.id,children:o.label},o.id))})]})]})}function B9({free:e,tools:t,reasoning:r,vision:n,tee:i}){return v.jsxs("span",{className:"flex flex-wrap gap-1",children:[e&&v.jsx(Ar,{tone:"free",children:"Free"}),i&&v.jsx(Ar,{tone:"tee",children:"TEE"}),t&&v.jsx(Ar,{children:"Tools"}),r&&v.jsx(Ar,{children:"Reasoning"}),n&&v.jsx(Ar,{children:"Vision"})]})}function F9(e){const[t,r]=k.useState(()=>new Set(Yo(e,[])));return[t,i=>r(s=>{const a=new Set(s);return a.has(i)?a.delete(i):a.add(i),Ko(e,[...a]),a})]}function z9(e,t){const[r,n]=k.useState(()=>Yo(e,t));return[r,i=>{n(i),Ko(e,i)}]}function Vm(e){return wl(e)?"Free":`${C6(e.inputUsdPerMillion)} / ${C6(e.outputUsdPerMillion)} per M`}function r0e({models:e,value:t,onChange:r,className:n}){const[i,s]=k.useState(!1),[a,o]=F9("model-filters"),[l,u]=z9("model-sort","popular"),c=vO(e,a,l);return v.jsxs(Bw,{open:i,onOpenChange:s,children:[v.jsx(Fw,{asChild:!0,children:v.jsxs(Hr,{variant:"outline",size:"sm",className:Ie("max-w-80 justify-between gap-2",n),children:[v.jsx("span",{className:"truncate",children:t?t.name:"Pick a model"}),t&&t.inputUsdPerMillion!==null&&(t.free?v.jsx(Ar,{tone:"free",children:"Free offers"}):v.jsxs("span",{className:"text-muted-foreground text-xs max-sm:hidden",children:["from ",Vm(t)]})),v.jsx(T5,{className:"size-3.5 opacity-60"})]})}),v.jsxs(zw,{title:"Model",className:"sm:max-w-2xl",children:[v.jsx($w,{placeholder:"Search models…"}),v.jsx(M9,{filters:mO,active:a,onToggle:o,sorts:pO,sort:l,onSort:u,count:`${c.length} of ${e.length} models`}),v.jsxs(jw,{className:"max-h-[min(28rem,60vh)]",children:[v.jsxs(Uw,{children:["No model matches.",a.size>0?" Try fewer filters.":""]}),v.jsx(pm,{children:c.map(d=>v.jsxs(gm,{value:`${d.name} ${d.id}`,onSelect:()=>{r(d.id),s(!1)},className:"items-start py-2",children:[v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx(bm,{children:d.name}),v.jsx(B9,{free:d.free,tools:d.toolUse,reasoning:d.reasoning,vision:d.vision,tee:d.tee})]}),v.jsxs("span",{className:"ml-auto shrink-0 text-right text-muted-foreground text-xs",children:[d.offers," seller",d.offers===1?"":"s",v.jsx("span",{className:"mt-0.5 block",children:d.free?v.jsx(Ar,{tone:"free",children:"Free offers"}):`from ${Vm(d)}`})]}),(t==null?void 0:t.id)===d.id&&v.jsx(ac,{className:"size-3.5 shrink-0"})]},d.id))})]})]})]})}function qm({children:e}){return v.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[v.jsx("span",{className:"size-2 shrink-0 translate-y-[-1px] rounded-full bg-amber-500","aria-hidden":"true"}),v.jsx("span",{children:e})]})}const I6=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"");function $9(e,t,r,n){if(r)return"Checking which seller automatic routing picks…";if(!e)return"No seller passes your routing settings for this model right now.";const i=t==null?void 0:t.peers.find(a=>a.peerId===e.peerId.toLowerCase()),s=za(i||{peerId:e.peerId,name:e.displayName});return v.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1.5 align-middle",children:["Right now:",v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(e.peerId.toLowerCase())},"aria-hidden":"true"}),v.jsx("span",{className:"font-medium text-foreground",children:s}),v.jsx(Hm,{offer:e}),e.trustScore!==null&&v.jsxs("span",{children:["trust ",Math.round(e.trustScore)]}),n&&!wl(e)&&v.jsxs(qm,{children:["No free seller offers ",(t==null?void 0:t.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",v.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:Zm("wallet"),onClick:Wm("wallet"),children:"Add funds"})]})]})}function N6({model:e,value:t,onChange:r,preview:n,previewLoading:i,unfunded:s,className:a,compact:o=!1}){const[l,u]=k.useState(!1),[c,d]=F9("peer-filters"),[h,f]=z9("peer-sort","auto"),m=(e==null?void 0:e.peers.find(_=>_.peerId===t))??null,b=xO(n),y=j5(n),E=y?(e==null?void 0:e.peers.find(_=>_.peerId===y.peerId.toLowerCase()))??null:null,w=(e==null?void 0:e.peers)??[],x=_O(w,c,h,b);return v.jsxs(Bw,{open:l,onOpenChange:u,children:[v.jsx(Fw,{asChild:!0,children:v.jsxs(Hr,{variant:o?"ghost":"outline",size:o?"xs":"sm",className:Ie("max-w-96 justify-between gap-2",a),disabled:!e,children:[m?v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(m.peerId)},"aria-hidden":"true"}):v.jsx(nb,{className:"size-3.5"}),v.jsx("span",{className:"truncate",children:m?za(m):v.jsxs(v.Fragment,{children:["Auto",E?v.jsxs("span",{className:"text-muted-foreground",children:[" · ",E.name??Aa(E.peerId)]}):""]})}),(m??E)&&!o&&v.jsx(Hm,{offer:m??E}),v.jsx(T5,{className:"size-3.5 opacity-60"})]})}),v.jsxs(zw,{title:"Seller",className:"sm:max-w-2xl",children:[v.jsx($w,{placeholder:"Search sellers…"}),v.jsx(M9,{filters:gO,active:c,onToggle:d,sorts:bO,sort:h,onSort:f,count:`${x.length} of ${w.length} sellers`}),v.jsxs(jw,{className:"max-h-[min(30rem,60vh)]",children:[v.jsxs(Uw,{children:["No seller matches.",c.size>0?" Try fewer filters.":""]}),v.jsx(pm,{heading:"Routing",children:v.jsxs(gm,{value:"auto automatic best offer routing",onSelect:()=>{r(null),u(!1)},className:"items-start py-2",children:[v.jsx(nb,{className:"mt-0.5 size-3.5"}),v.jsxs("span",{className:"flex min-w-0 flex-col",children:[v.jsx(bm,{children:"Auto: the gateway picks the best offer each turn"}),v.jsx("span",{className:"text-muted-foreground text-xs",children:$9(y,e,i,s)})]}),t===null&&v.jsx(ac,{className:"ml-auto size-3.5"})]})}),v.jsx(pm,{heading:`Sellers offering ${(e==null?void 0:e.name)??"this model"}`,children:x.map(_=>{const A=b.get(_.peerId),S=A!==void 0&&!A.eligible;return v.jsxs(gm,{value:`${_.name??""} ${_.peerId}`,onSelect:()=>{r(_.peerId),u(!1)},className:"items-start py-2",children:[v.jsx("span",{className:"mt-1.5 size-2 shrink-0 rounded-full",style:{background:Kc(_.peerId)},"aria-hidden":"true"}),v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsxs("span",{className:`flex items-center gap-2 ${S?"text-muted-foreground":""}`,children:[v.jsx(bm,{children:za(_)}),(A==null?void 0:A.eligible)&&A.rank!==null&&v.jsxs("span",{className:"text-muted-foreground text-xs",children:["#",A.rank]})]}),v.jsx(B9,{free:wl(_),tools:_.toolUse,reasoning:_.reasoning,vision:_.vision,tee:_.tee}),S&&v.jsxs("span",{className:"text-muted-foreground text-xs",children:["Auto skips it: ",A.reasons[0]??"not eligible",". You can still pin it."]}),!_.toolUse&&v.jsx("span",{className:"text-muted-foreground text-xs",children:"No tools: plain chat when pinned."})]}),v.jsxs("span",{className:"ml-auto flex shrink-0 flex-col items-end gap-0.5 text-muted-foreground text-xs",children:[v.jsx(Hm,{offer:_}),_.reputation!==null&&v.jsxs("span",{children:["trust ",Math.round(_.reputation)]})]}),t===_.peerId&&v.jsx(ac,{className:"size-3.5 shrink-0"})]},_.peerId)})})]})]})]})}function n0e({part:e,onAnswer:t}){const r=e.input,n=typeof(r==null?void 0:r.command)=="string"?r.command:JSON.stringify(e.input,null,2);return v.jsxs("div",{className:"space-y-2 border-t p-3",children:[v.jsx("p",{className:"font-medium text-sm",children:"Run this command on the gateway host?"}),v.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/50 p-2 font-mono text-xs",children:n}),v.jsx("p",{className:"text-muted-foreground text-xs",children:"It runs as the gateway's user, with access to its files. The model chose it, and a seller or a page it read can steer the model: approve only a command you understand."}),t?v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Hr,{type:"button",size:"sm",variant:"secondary",onClick:()=>t(!0),children:"Approve"}),v.jsx(Hr,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!1),children:"Deny"})]}):v.jsx("p",{className:"text-muted-foreground text-xs",children:"Not run: the conversation moved on."})]})}function i0e({part:e,onApproval:t}){const r=e.state==="approval-requested";return v.jsxs(Vce,{defaultOpen:e.state==="output-error",children:[e.type==="dynamic-tool"?v.jsx(S6,{type:e.type,state:e.state,toolName:e.toolName}):v.jsx(S6,{type:e.type,state:e.state}),v.jsxs(Zce,{children:[v.jsx(Yce,{input:e.input}),v.jsx(Kce,{output:e.output,errorText:e.errorText})]}),r&&v.jsx(n0e,{part:e,onAnswer:t?n=>t(e.approval.id,n):null})]})}function R6({threads:e,loading:t,activeId:r,onOpen:n,onRemove:i}){return e.length===0?v.jsx("p",{className:"px-2 py-3 text-muted-foreground text-xs",children:t?"Loading…":"Your conversations show up here."}):e.map(s=>v.jsxs("div",{className:`group flex items-center gap-1 rounded-md px-2 py-1.5 text-sm ${s.id===r?"bg-muted":"hover:bg-muted/60"}`,children:[v.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>n(s.id),title:s.title,children:[v.jsx("span",{className:"block truncate",children:s.title}),v.jsxs("span",{className:"block truncate text-muted-foreground text-xs",children:[rS(s.updatedAt),s.model?` · ${s.model}`:"",s.peerId?` · ${Aa(s.peerId)}`:""]})]}),v.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:text-foreground focus-visible:opacity-100 md:opacity-0 md:group-hover:opacity-100","aria-label":`Delete "${s.title}"`,onClick:()=>i(s.id),children:v.jsx(hO,{className:"size-3.5"})})]},s.id))}function s0e(){var Ae,ze,re,Le,et;const{workspace:e,viewer:t,me:r}=Z9(),n=`${e.id}:${r.member.id}`,i=co({queryKey:tn.chatModels(e.id),queryFn:()=>Ws.chat.models(e.id),staleTime:6e4}),[s,a]=k.useState(()=>Yo(`model:${n}`,null)),[o,l]=k.useState(()=>Yo(`peer:${n}`,null)),u=Y9(),c=co({queryKey:tn.chatThreads(e.id),queryFn:()=>Ws.chat.threads(e.id)}),d=co({queryKey:tn.chatContext(e.id),queryFn:()=>Ws.chat.context(e.id),staleTime:3e4}),h=Xce(),[f,m]=k.useState(()=>Yo(`chat:${n}`,A6())),[b,y]=k.useState(!1),E=((Ae=i.data)==null?void 0:Ae.find(Te=>Te.id===s))??(s?(ze=i.data)==null?void 0:ze.find(Te=>I6(Te.id)===I6(s)):void 0)??null,[w,x]=k.useState(null),_=K9(t),A=X9(e.id,_),S=!!A.data&&Number(A.data.available)<=0,I=((re=d.data)==null?void 0:re.key.id)??null,N=co({queryKey:["chat-route-preview",e.id,I,s],queryFn:()=>Ws.network.routePreview({model:s,key:I}),enabled:!!(s&&I),staleTime:3e4});k.useEffect(()=>{var Ke;if(!((Ke=i.data)!=null&&Ke.length)||E)return;const Te=i.data.find(ot=>ot.toolUse)??i.data[0];s&&x(s),a(Te.id)},[i.data,E]),k.useEffect(()=>{Ko(`model:${n}`,s)},[n,s]),k.useEffect(()=>{Ko(`peer:${n}`,o)},[n,o]),k.useEffect(()=>{Ko(`chat:${n}`,f)},[n,f]);const U=k.useRef({workspaceId:e.id,model:s,peerId:o});U.current={workspaceId:e.id,model:s,peerId:o};const z=k.useMemo(()=>new sp({api:`${Q9}/chat`,credentials:"same-origin",headers:{[J9]:"1"},prepareSendMessagesRequest:({id:Te,messages:Ke})=>({body:{...U.current,id:Te,messages:Ke.slice(-1)}})}),[]),{messages:Z,sendMessage:V,status:ae,stop:J,error:Y,setMessages:de,clearError:xe,addToolApprovalResponse:Ue}=qP({id:f,transport:z,sendAutomaticallyWhen:MP}),He=co({queryKey:tn.chatThread(e.id,f),queryFn:()=>Ws.chat.thread(e.id,f),enabled:(c.data??[]).some(Te=>Te.id===f),staleTime:1/0});k.useEffect(()=>{He.data&&(de(He.data.messages),He.data.model&&a(He.data.model),l(He.data.peerId))},[He.data]),k.useEffect(()=>{(ae==="streaming"||ae==="ready")&&Z.length>0&&u.invalidateQueries({queryKey:tn.chatThreads(e.id)}),ae==="ready"&&Z.length>0&&(u.removeQueries({queryKey:tn.chatThread(e.id,f),exact:!0}),u.invalidateQueries({queryKey:tn.chatContext(e.id)}),u.invalidateQueries({queryKey:["chat-route-preview",e.id]}))},[ae]),k.useEffect(()=>{Y&&(u.invalidateQueries({queryKey:tn.chatModels(e.id)}),u.invalidateQueries({queryKey:["chat-route-preview",e.id]}),_&&u.invalidateQueries({queryKey:tn.wallet(e.id)}))},[Y]);const L=ae==="submitted"||ae==="streaming",Re=Z.reduce((Te,Ke)=>{var Rt;const ot=(Rt=Ke.metadata)==null?void 0:Rt.costUsd;return Te===null||ot===null?null:Te+(ot??0)},0),Q=Te=>{const Ke=Te.text.trim();!Ke||!s||L||(u.setQueryData(tn.chatThreads(e.id),(ot=[])=>ot.some(Rt=>Rt.id===f)?ot:[{id:f,title:Ke.replace(/\s+/g," ").slice(0,80),model:s,peerId:o,createdAt:Date.now(),updatedAt:Date.now()},...ot]),V({text:Ke}))},M=Te=>{y(!1),!(Te===f||L)&&(xe(),de([]),m(Te))},pe=()=>{y(!1),J(),xe(),de([]),m(A6())},oe=eS({mutationFn:Te=>Ws.chat.deleteThread(e.id,Te),onSuccess:(Te,Ke)=>{Ke===f&&pe()},invalidate:[tn.chatThreads(e.id)]}),fe=["What are today's top AI news? Search and cite sources.","Read https://antseed.com and explain how it works in 5 bullets.",yg(t)?"Write a Python script that prints the first 20 primes, save it and run it.":"Write a short README for a CLI tool and save it as README.md."];return v.jsxs("div",{ref:h,className:"gc-chat gc-chat-page flex gap-4",children:[v.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col gap-2 md:flex","aria-label":"Conversations",children:[v.jsxs(Hr,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:pe,disabled:Z.length===0&&!L,children:[v.jsx(od,{className:"size-3.5"})," New chat"]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:v.jsx(R6,{threads:c.data??[],loading:c.isLoading,activeId:f,onOpen:M,onRemove:Te=>oe.mutate(Te)})})]}),v.jsxs(tS,{isOpen:b,onClose:()=>y(!1),side:"left",title:"Chats",className:"gc-chat gc-chat-history",children:[v.jsxs(Hr,{variant:"outline",size:"sm",className:"mb-2 w-full justify-start gap-2",onClick:pe,children:[v.jsx(od,{className:"size-3.5"})," New chat"]}),v.jsx(R6,{threads:c.data??[],loading:c.isLoading,activeId:f,onOpen:M,onRemove:Te=>oe.mutate(Te)})]}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3 max-sm:gap-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 max-sm:flex-nowrap max-sm:gap-1",children:[v.jsx(Hr,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:()=>y(!0),"aria-label":"Chats",children:v.jsx(lO,{className:"size-4"})}),v.jsx("h1",{className:"mr-auto font-semibold text-xl max-sm:sr-only",children:"Chat"}),v.jsx(r0e,{models:i.data??[],value:E,onChange:Te=>{a(Te),l(null),x(null)},className:"max-sm:mx-auto max-sm:min-w-0 max-sm:border-transparent max-sm:bg-transparent max-sm:font-semibold max-sm:shadow-none max-sm:dark:border-transparent max-sm:dark:bg-transparent"}),v.jsx(N6,{model:E,value:o,onChange:l,preview:N.data,previewLoading:N.isLoading,unfunded:S,className:"max-sm:hidden"}),v.jsxs(Hr,{variant:"ghost",size:"sm",className:"shrink-0 md:hidden max-sm:size-8 max-sm:p-0",onClick:pe,disabled:Z.length===0&&!L,"aria-label":"New chat",children:[v.jsx(od,{className:"size-4"})," ",v.jsx("span",{className:"max-sm:sr-only",children:"New"})]})]}),v.jsxs("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:[o&&E?v.jsxs(v.Fragment,{children:["Every turn goes to ",v.jsx("span",{className:"font-medium text-foreground",children:za(E.peers.find(Te=>Te.peerId===o)??{peerId:o,name:null})}),". Each answer shows the peer that served it."]}):v.jsxs(v.Fragment,{children:["The gateway routes each turn to the best offer for ",(E==null?void 0:E.name)??"the model","; each answer shows the seller that served it, and you can pin one to always use it."]})," ","Tools run on the gateway."]}),w&&E&&v.jsx("p",{className:"text-muted-foreground text-xs",children:v.jsxs(qm,{children:["No seller offers ",w," right now (sellers stop offering a model while they are busy), so the chat switched to ",E.name,"."]})}),o&&E&&!E.peers.some(Te=>Te.peerId===o)&&v.jsx("p",{className:"text-muted-foreground text-xs",children:v.jsxs(qm,{children:[Aa(o)," no longer offers ",E.name," (sellers stop offering a model while they are busy)."," ",v.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:()=>l(null),children:"Use Auto"})," or pick another seller."]})}),!o&&v.jsx("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:$9(j5(N.data),E,N.isLoading,S)}),v.jsx("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:v.jsx(Qce,{apiKey:(Le=d.data)==null?void 0:Le.key,workspaceName:((et=d.data)==null?void 0:et.workspaceName)??e.name,chatCost:Re})}),v.jsxs(SD,{className:"gc-chat-conversation rounded-xl border bg-card max-sm:rounded-none max-sm:border-0 max-sm:bg-transparent",children:[v.jsxs(AD,{className:"max-sm:gap-6 max-sm:px-0",children:[Z.length===0?v.jsx(CD,{children:v.jsxs("div",{className:"flex w-full min-w-0 max-w-2xl flex-col items-center gap-2 text-center",children:[v.jsx("h3",{className:"font-medium text-base",children:"Ask anything"}),v.jsx("p",{className:"text-muted-foreground text-sm",children:"The agent can search and read the web and keep files in this chat's scratch space on the gateway."}),v.jsx("div",{className:"mt-3 flex flex-wrap justify-center gap-2",children:fe.map(Te=>v.jsx(Rce,{suggestion:Te,onClick:Ke=>Q({text:Ke}),className:"h-auto min-h-8 max-w-full whitespace-normal py-1.5 max-sm:w-full max-sm:rounded-xl max-sm:text-left"},Te))})]})}):Z.map((Te,Ke)=>{const ot=L&&Ke===Z.length-1;return v.jsxs(mie,{from:Te.role,children:[v.jsx(e0e,{message:Te,streaming:ot,initials:Jce(r.member.label)}),v.jsx(pie,{children:Te.parts.map((Rt,bn)=>{const Jr=`${Te.id}-${bn}`;if(Rt.type==="text")return v.jsx(_w,{children:Rt.text},Jr);if(Rt.type==="reasoning")return v.jsxs(N9,{isStreaming:ot&&bn===Te.parts.length-1,children:[v.jsx(R9,{}),v.jsx(P9,{children:Rt.text})]},Jr);if(Rt.type==="dynamic-tool"||Rt.type.startsWith("tool-")){const $n=!L&&Ke===Z.length-1;return v.jsx(i0e,{part:Rt,onApproval:$n?(_r,en)=>{Ue({id:_r,approved:en})}:null},Jr)}return null})}),Te.role==="assistant"&&v.jsx(t0e,{metadata:Te.metadata})]},Te.id)}),Y&&v.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:/out of AntSeed credits|insufficient_deposits/i.test(Y.message)?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-medium",children:"No free seller took this, and paid ones need funds."})," ","No free seller offers ",(E==null?void 0:E.name)??"this model"," right now (free sellers stop offering a model while they are busy), and the ",e.name," wallet has no deposits for a paid one."," ",v.jsx("a",{className:"font-medium underline underline-offset-2",href:Zm("wallet"),onClick:Wm("wallet"),children:"Add funds"}),", or pick a model marked ",v.jsx(Ar,{tone:"free",children:"Free"}),"."]}):/model_not_found|not served by this peer/i.test(Y.message)?v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"font-medium",children:["The seller stopped offering ",(E==null?void 0:E.name)??"this model","."]})," ","Sellers drop a model while they are busy, and the list had not caught up yet. Send again",o?v.jsxs(v.Fragment,{children:[" after switching to ",v.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:()=>l(null),children:"Auto"})]}):""," to use another seller."]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-medium",children:"The request failed."})," ",Y.message]})})]}),v.jsx(ID,{})]}),v.jsxs(vse,{onSubmit:Q,className:"max-sm:[&_[data-slot=input-group]]:rounded-3xl",children:[v.jsx(xse,{children:v.jsx(Ese,{placeholder:E?`Message ${E.name}…`:"Loading models…",className:"max-sm:min-h-10"})}),v.jsxs(_se,{children:[v.jsxs(Tse,{className:"min-w-0",children:[v.jsx(N6,{model:E,value:o,onChange:l,preview:N.data,previewLoading:N.isLoading,unfunded:S,compact:!0,className:"min-w-0 max-w-[65vw] text-muted-foreground sm:hidden"}),v.jsxs("span",{className:"px-2 text-muted-foreground text-xs max-sm:hidden",children:[E?E.toolUse?"Web search, web pages and scratch files":"This model cannot use tools; plain chat":"",E!=null&&E.toolUse&&yg(t)?", plus a shell that asks before each command (admins)":""]})]}),v.jsx(wse,{status:ae,onStop:J,disabled:!s})]})]})]})]})}const _0e=Object.freeze(Object.defineProperty({__proto__:null,default:s0e},Symbol.toStringTag,{value:"Module"})),a0e=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:vw},Symbol.toStringTag,{value:"Module"}));export{_0e as C,x0e as F,Zt as S,fre as a};
793
+ `).map(t=>t===""?[]:[{color:"inherit",content:t}])}),k6=(e,t,r)=>{var s;const n=zce(e,t),i=w6.get(n);return i||(r&&(na.has(n)||na.set(n,new Set),(s=na.get(n))==null||s.add(r)),$ce(t).then(a=>{const l=a.getLoadedLanguages().includes(t)?t:"text",u=a.codeToTokens(e,{lang:l,themes:{dark:"github-dark",light:"github-light"}}),c={bg:u.bg??"transparent",fg:u.fg??"inherit",tokens:u.tokens};w6.set(n,c);const d=na.get(n);if(d){for(const h of d)h(c);na.delete(n)}}).catch(a=>{console.error("Failed to highlight code:",a),na.delete(n)}),null)},O9=k.memo(({tokenized:e,showLineNumbers:t,className:r})=>{const n=k.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=k.useMemo(()=>Dce(e.tokens),[e.tokens]);return v.jsx("pre",{className:Ie("dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",r),style:n,children:v.jsx("code",{className:Ie("font-mono text-sm",t&&"[counter-increment:line_0] [counter-reset:line]"),children:i.map(s=>v.jsx(Fce,{keyedLine:s,showLineNumbers:t},s.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);O9.displayName="CodeBlockBody";const Uce=({className:e,language:t,style:r,...n})=>v.jsx("div",{className:Ie("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",e),"data-language":t,style:{containIntrinsicSize:"auto 200px",contentVisibility:"auto",...r},...n}),Hce=({code:e,language:t,showLineNumbers:r=!1})=>{const n=k.useMemo(()=>jce(e),[e]),i=k.useMemo(()=>k6(e,t)??n,[e,t,n]),[s,a]=k.useState(null),o=k.useRef({code:e,language:t});(o.current.code!==e||o.current.language!==t)&&(o.current={code:e,language:t},a(null)),k.useEffect(()=>{let u=!1;return k6(e,t,c=>{u||a(c)}),()=>{u=!0}},[e,t]);const l=s??i;return v.jsx("div",{className:"relative overflow-auto",children:v.jsx(O9,{showLineNumbers:r,tokenized:l})})},Um=({code:e,language:t,showLineNumbers:r=!1,className:n,children:i,...s})=>v.jsxs(Uce,{className:n,language:t,...s,children:[i,v.jsx(Hce,{code:e,language:t,showLineNumbers:r})]}),Vce=({className:e,...t})=>v.jsx(Hw,{className:Ie("group not-prose mb-4 w-full rounded-md border",e),...t}),qce={"approval-requested":"Awaiting Approval","approval-responded":"Responded","input-available":"Running","input-streaming":"Pending","output-available":"Completed","output-denied":"Denied","output-error":"Error"},Gce={"approval-requested":v.jsx(rb,{className:"size-3 text-muted-foreground"}),"approval-responded":v.jsx(eb,{className:"size-3 text-muted-foreground"}),"input-available":v.jsx(rb,{className:"size-3 animate-pulse"}),"input-streaming":v.jsx(iO,{className:"size-3"}),"output-available":v.jsx(eb,{className:"size-3 text-green-600"}),"output-denied":v.jsx(tb,{className:"size-3 text-orange-600"}),"output-error":v.jsx(tb,{className:"size-3 text-red-600"})},Wce=e=>v.jsxs(W9,{children:[Gce[e],qce[e]]}),S6=({className:e,title:t,type:r,state:n,toolName:i,...s})=>{const a=r==="dynamic-tool"?i:r.split("-").slice(1).join("-");return v.jsxs(Vw,{className:Ie("flex w-full items-center justify-between gap-4 p-3",e),...s,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(fO,{className:"size-4 text-muted-foreground"}),v.jsx("span",{className:"font-medium text-sm",children:t??a}),Wce(n)]}),v.jsx(E5,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})},Zce=({className:e,...t})=>v.jsx(qw,{className:Ie("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Yce=({className:e,input:t,...r})=>v.jsxs("div",{className:Ie("space-y-2 overflow-hidden",e),...r,children:[v.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),v.jsx("div",{className:"rounded-md bg-muted/50",children:v.jsx(Um,{code:JSON.stringify(t,null,2),language:"json"})})]}),Kce=({className:e,output:t,errorText:r,...n})=>{if(!(t||r))return null;let i=v.jsx("div",{children:t});return typeof t=="object"&&!k.isValidElement(t)?i=v.jsx(Um,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(i=v.jsx(Um,{code:t,language:"json"})),v.jsxs("div",{className:Ie("space-y-2",e),...n,children:[v.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:r?"Error":"Result"}),v.jsxs("div",{className:Ie("overflow-x-auto rounded-md text-xs [&_table]:w-full",r?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[r&&v.jsx("div",{children:r}),i]})]})},L9="antseed-console-chat";function Yo(e,t){try{const r=localStorage.getItem(`${L9}:${e}`);return r?JSON.parse(r):t}catch{return t}}function Ko(e,t){try{localStorage.setItem(`${L9}:${e}`,JSON.stringify(t))}catch{}}function A6(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function C6(e){return e===null?"?":`$${e<.01?e.toFixed(3):e.toFixed(2)}`}function D9(e){return e===null?"cost unknown":`≈ ${Lh(e??0)}`}const Xce="(max-width: 640px)";function Qce(){const e=k.useRef(null);return k.useLayoutEffect(()=>{const t=e.current;if(!t)return;const r=document.documentElement,n=window.matchMedia(Xce),i=window.visualViewport,s=()=>{if(n.matches){t.style.height&&(t.style.height=""),i&&(r.style.setProperty("--gc-vvh",`${i.height}px`),r.style.setProperty("--gc-vvtop",`${i.offsetTop}px`));return}const o=t.getBoundingClientRect().top+window.scrollY,l=t.closest("main"),u=l&&parseFloat(getComputedStyle(l).paddingBottom)||0,c=`${Math.max(448,window.innerHeight-o-u)}px`;t.style.height!==c&&(t.style.height=c)};s();const a=new ResizeObserver(s);return a.observe(document.body),window.addEventListener("resize",s),n.addEventListener("change",s),i==null||i.addEventListener("resize",s),i==null||i.addEventListener("scroll",s),()=>{a.disconnect(),window.removeEventListener("resize",s),n.removeEventListener("change",s),i==null||i.removeEventListener("resize",s),i==null||i.removeEventListener("scroll",s),r.style.removeProperty("--gc-vvh"),r.style.removeProperty("--gc-vvtop")}},[]),e}function Jce({apiKey:e,workspaceName:t,chatCost:r}){var s;if(!e)return v.jsxs("span",{children:["Paid by ",t,"."]});const n=[e.limits.monthly,((s=e.ownerLimits)==null?void 0:s.monthly)??null].filter(a=>a!==null),i=n.length?n.reduce((a,o)=>Number(o)<Number(a)?o:a):null;return v.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-1.5 gap-y-0.5",children:[v.jsx(aO,{className:"size-3.5"}),v.jsxs("span",{children:["Paid by ",t," with key"]}),v.jsxs("a",{className:"font-medium text-foreground underline-offset-2 hover:underline",href:Zm("keys"),onClick:Wm("keys"),title:`Key ${e.id}`,children:[e.label," ",v.jsxs("span",{className:"font-mono text-muted-foreground",children:["…",e.hint]})]}),v.jsxs("span",{children:["· ",Lh(e.usage.spentThisMonth)," this month",i?` of ${Lh(i)}`:""]}),r!==0&&v.jsxs("span",{children:["· this chat ",D9(r)]})]})}function za(e){return e.name?`${e.name} (${Aa(e.peerId)})`:Aa(e.peerId)}function e0e(e){var r;const t=e.trim().split(/\s+/).filter(Boolean);return((((r=t[0])==null?void 0:r[0])??"?")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()}function Ar({tone:e="neutral",children:t,title:r}){const n={free:"border-success/30 bg-success/10 text-success",tee:"border-info/30 bg-info/10 text-info",neutral:"border-border text-muted-foreground"};return v.jsx("span",{title:r,className:`inline-flex items-center rounded border px-1.5 py-px font-medium text-[10px] leading-4 ${n[e]}`,children:t})}function Kc(e){let t=0;for(const r of e)t=(t*31+r.charCodeAt(0))%360;return`hsl(${t} 65% 55%)`}function Hm({offer:e}){return wl(e)?v.jsx(Ar,{tone:"free",children:"Free"}):v.jsx("span",{className:"text-muted-foreground text-xs",children:Vm(e)})}function t0e({message:e,streaming:t,initials:r}){var a;if(e.role==="user")return v.jsxs("div",{className:"flex items-center justify-end gap-1.5 text-xs",children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:"You"}),v.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-foreground font-semibold text-[9px] text-background",children:r})]});const n=e.metadata;if(!n)return null;const i=n.peers,s=n.costUsd===0&&(((a=n.usage)==null?void 0:a.outputTokens)??0)>0;return v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-xs","aria-live":"polite",children:[i.length===0?v.jsx("span",{className:"text-muted-foreground",children:t?n.pinnedPeerId?`Waiting for ${Aa(n.pinnedPeerId)}…`:"Choosing a seller…":"No seller answered"}):i.map((o,l)=>v.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l>0&&v.jsx("span",{className:"text-muted-foreground",children:"then"}),v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(o.peerId)},"aria-hidden":"true"}),v.jsx("span",{className:"font-medium text-foreground",title:o.peerId,children:za(o)})]},`${o.peerId}-${l}`)),v.jsx(Ar,{children:n.model}),n.pinnedPeerId&&v.jsx(Ar,{children:"Pinned"}),s&&v.jsx(Ar,{tone:"free",children:"Free"})]})}function r0e({metadata:e}){const t=e==null?void 0:e.usage;return!t||t.inputTokens===0&&t.outputTokens===0?null:v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-muted-foreground text-xs",children:[v.jsx(cO,{className:"size-3.5"}),v.jsxs("span",{children:[vg(t.inputTokens)," in / ",vg(t.outputTokens)," out tokens"]}),v.jsx("span",{children:"·"}),e.costUsd===0?v.jsx(Ar,{tone:"free",children:"Free"}):v.jsx("span",{className:"font-medium text-foreground",title:"At the serving seller's advertised prices; the signed amount is in Logs.",children:D9(e.costUsd)})]})}function M9({filters:e,active:t,onToggle:r,sorts:n,sort:i,onSort:s,count:a}){return v.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b px-3 py-2",children:[e.map(o=>v.jsxs(Hr,{type:"button",size:"xs",variant:t.has(o.id)?"secondary":"ghost","aria-pressed":t.has(o.id),className:t.has(o.id)?"border border-foreground/30":"border border-transparent text-muted-foreground",onClick:()=>r(o.id),children:[t.has(o.id)&&v.jsx(ac,{}),o.label]},o.id)),v.jsx("span",{className:"ml-auto text-muted-foreground text-xs",children:a}),v.jsxs("label",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:["Sort",v.jsx("select",{className:"rounded-md border bg-transparent px-1.5 py-0.5 text-foreground text-xs",value:i,onChange:o=>s(o.target.value),children:n.map(o=>v.jsx("option",{value:o.id,children:o.label},o.id))})]})]})}function B9({free:e,tools:t,reasoning:r,vision:n,tee:i}){return v.jsxs("span",{className:"flex flex-wrap gap-1",children:[e&&v.jsx(Ar,{tone:"free",children:"Free"}),i&&v.jsx(Ar,{tone:"tee",children:"TEE"}),t&&v.jsx(Ar,{children:"Tools"}),r&&v.jsx(Ar,{children:"Reasoning"}),n&&v.jsx(Ar,{children:"Vision"})]})}function F9(e){const[t,r]=k.useState(()=>new Set(Yo(e,[])));return[t,i=>r(s=>{const a=new Set(s);return a.has(i)?a.delete(i):a.add(i),Ko(e,[...a]),a})]}function z9(e,t){const[r,n]=k.useState(()=>Yo(e,t));return[r,i=>{n(i),Ko(e,i)}]}function Vm(e){return wl(e)?"Free":`${C6(e.inputUsdPerMillion)} / ${C6(e.outputUsdPerMillion)} per M`}function n0e({models:e,value:t,onChange:r,className:n}){const[i,s]=k.useState(!1),[a,o]=F9("model-filters"),[l,u]=z9("model-sort","popular"),c=vO(e,a,l);return v.jsxs(Bw,{open:i,onOpenChange:s,children:[v.jsx(Fw,{asChild:!0,children:v.jsxs(Hr,{variant:"outline",size:"sm",className:Ie("max-w-80 justify-between gap-2",n),children:[v.jsx("span",{className:"truncate",children:t?t.name:"Pick a model"}),t&&t.inputUsdPerMillion!==null&&(t.free?v.jsx(Ar,{tone:"free",children:"Free offers"}):v.jsxs("span",{className:"text-muted-foreground text-xs max-sm:hidden",children:["from ",Vm(t)]})),v.jsx(T5,{className:"size-3.5 opacity-60"})]})}),v.jsxs(zw,{title:"Model",className:"sm:max-w-2xl",children:[v.jsx($w,{placeholder:"Search models…"}),v.jsx(M9,{filters:mO,active:a,onToggle:o,sorts:pO,sort:l,onSort:u,count:`${c.length} of ${e.length} models`}),v.jsxs(jw,{className:"max-h-[min(28rem,60vh)]",children:[v.jsxs(Uw,{children:["No model matches.",a.size>0?" Try fewer filters.":""]}),v.jsx(pm,{children:c.map(d=>v.jsxs(gm,{value:`${d.name} ${d.id}`,onSelect:()=>{r(d.id),s(!1)},className:"items-start py-2",children:[v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx(bm,{children:d.name}),v.jsx(B9,{free:d.free,tools:d.toolUse,reasoning:d.reasoning,vision:d.vision,tee:d.tee})]}),v.jsxs("span",{className:"ml-auto shrink-0 text-right text-muted-foreground text-xs",children:[d.offers," seller",d.offers===1?"":"s",v.jsx("span",{className:"mt-0.5 block",children:d.free?v.jsx(Ar,{tone:"free",children:"Free offers"}):`from ${Vm(d)}`})]}),(t==null?void 0:t.id)===d.id&&v.jsx(ac,{className:"size-3.5 shrink-0"})]},d.id))})]})]})]})}function qm({children:e}){return v.jsxs("span",{className:"inline-flex items-baseline gap-1.5",children:[v.jsx("span",{className:"size-2 shrink-0 translate-y-[-1px] rounded-full bg-amber-500","aria-hidden":"true"}),v.jsx("span",{children:e})]})}const I6=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"");function $9(e,t,r,n){if(r)return"Checking which seller automatic routing picks…";if(!e)return"No seller passes your routing settings for this model right now.";const i=t==null?void 0:t.peers.find(a=>a.peerId===e.peerId.toLowerCase()),s=za(i||{peerId:e.peerId,name:e.displayName});return v.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1.5 align-middle",children:["Right now:",v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(e.peerId.toLowerCase())},"aria-hidden":"true"}),v.jsx("span",{className:"font-medium text-foreground",children:s}),v.jsx(Hm,{offer:e}),e.trustScore!==null&&v.jsxs("span",{children:["trust ",Math.round(e.trustScore)]}),n&&!wl(e)&&v.jsxs(qm,{children:["No free seller offers ",(t==null?void 0:t.name)??"this model"," right now, and the wallet has no funds for a paid one."," ",v.jsx("a",{className:"font-medium text-foreground underline underline-offset-2",href:Zm("wallet"),onClick:Wm("wallet"),children:"Add funds"})]})]})}function N6({model:e,value:t,onChange:r,preview:n,previewLoading:i,unfunded:s,className:a,compact:o=!1}){const[l,u]=k.useState(!1),[c,d]=F9("peer-filters"),[h,f]=z9("peer-sort","auto"),m=(e==null?void 0:e.peers.find(_=>_.peerId===t))??null,b=xO(n),y=j5(n),E=y?(e==null?void 0:e.peers.find(_=>_.peerId===y.peerId.toLowerCase()))??null:null,w=(e==null?void 0:e.peers)??[],x=_O(w,c,h,b);return v.jsxs(Bw,{open:l,onOpenChange:u,children:[v.jsx(Fw,{asChild:!0,children:v.jsxs(Hr,{variant:o?"ghost":"outline",size:o?"xs":"sm",className:Ie("max-w-96 justify-between gap-2",a),disabled:!e,children:[m?v.jsx("span",{className:"size-2 rounded-full",style:{background:Kc(m.peerId)},"aria-hidden":"true"}):v.jsx(nb,{className:"size-3.5"}),v.jsx("span",{className:"truncate",children:m?za(m):v.jsxs(v.Fragment,{children:["Auto",E?v.jsxs("span",{className:"text-muted-foreground",children:[" · ",E.name??Aa(E.peerId)]}):""]})}),(m??E)&&!o&&v.jsx(Hm,{offer:m??E}),v.jsx(T5,{className:"size-3.5 opacity-60"})]})}),v.jsxs(zw,{title:"Seller",className:"sm:max-w-2xl",children:[v.jsx($w,{placeholder:"Search sellers…"}),v.jsx(M9,{filters:gO,active:c,onToggle:d,sorts:bO,sort:h,onSort:f,count:`${x.length} of ${w.length} sellers`}),v.jsxs(jw,{className:"max-h-[min(30rem,60vh)]",children:[v.jsxs(Uw,{children:["No seller matches.",c.size>0?" Try fewer filters.":""]}),v.jsx(pm,{heading:"Routing",children:v.jsxs(gm,{value:"auto automatic best offer routing",onSelect:()=>{r(null),u(!1)},className:"items-start py-2",children:[v.jsx(nb,{className:"mt-0.5 size-3.5"}),v.jsxs("span",{className:"flex min-w-0 flex-col",children:[v.jsx(bm,{children:"Auto: the gateway picks the best offer each turn"}),v.jsx("span",{className:"text-muted-foreground text-xs",children:$9(y,e,i,s)})]}),t===null&&v.jsx(ac,{className:"ml-auto size-3.5"})]})}),v.jsx(pm,{heading:`Sellers offering ${(e==null?void 0:e.name)??"this model"}`,children:x.map(_=>{const A=b.get(_.peerId),S=A!==void 0&&!A.eligible;return v.jsxs(gm,{value:`${_.name??""} ${_.peerId}`,onSelect:()=>{r(_.peerId),u(!1)},className:"items-start py-2",children:[v.jsx("span",{className:"mt-1.5 size-2 shrink-0 rounded-full",style:{background:Kc(_.peerId)},"aria-hidden":"true"}),v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsxs("span",{className:`flex items-center gap-2 ${S?"text-muted-foreground":""}`,children:[v.jsx(bm,{children:za(_)}),(A==null?void 0:A.eligible)&&A.rank!==null&&v.jsxs("span",{className:"text-muted-foreground text-xs",children:["#",A.rank]})]}),v.jsx(B9,{free:wl(_),tools:_.toolUse,reasoning:_.reasoning,vision:_.vision,tee:_.tee}),S&&v.jsxs("span",{className:"text-muted-foreground text-xs",children:["Auto skips it: ",A.reasons[0]??"not eligible",". You can still pin it."]}),!_.toolUse&&v.jsx("span",{className:"text-muted-foreground text-xs",children:"No tools: plain chat when pinned."})]}),v.jsxs("span",{className:"ml-auto flex shrink-0 flex-col items-end gap-0.5 text-muted-foreground text-xs",children:[v.jsx(Hm,{offer:_}),_.reputation!==null&&v.jsxs("span",{children:["trust ",Math.round(_.reputation)]})]}),t===_.peerId&&v.jsx(ac,{className:"size-3.5 shrink-0"})]},_.peerId)})})]})]})]})}function i0e({part:e,onAnswer:t}){const r=e.input,n=typeof(r==null?void 0:r.command)=="string"?r.command:JSON.stringify(e.input,null,2);return v.jsxs("div",{className:"space-y-2 border-t p-3",children:[v.jsx("p",{className:"font-medium text-sm",children:"Run this command on the gateway host?"}),v.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted/50 p-2 font-mono text-xs",children:n}),v.jsx("p",{className:"text-muted-foreground text-xs",children:"It runs as the gateway's user, with access to its files. The model chose it, and a seller or a page it read can steer the model: approve only a command you understand."}),t?v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Hr,{type:"button",size:"sm",variant:"secondary",onClick:()=>t(!0),children:"Approve"}),v.jsx(Hr,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!1),children:"Deny"})]}):v.jsx("p",{className:"text-muted-foreground text-xs",children:"Not run: the conversation moved on."})]})}function s0e({part:e,onApproval:t}){const r=e.state==="approval-requested";return v.jsxs(Vce,{defaultOpen:e.state==="output-error",children:[e.type==="dynamic-tool"?v.jsx(S6,{type:e.type,state:e.state,toolName:e.toolName}):v.jsx(S6,{type:e.type,state:e.state}),v.jsxs(Zce,{children:[v.jsx(Yce,{input:e.input}),v.jsx(Kce,{output:e.output,errorText:e.errorText})]}),r&&v.jsx(i0e,{part:e,onAnswer:t?n=>t(e.approval.id,n):null})]})}function R6({threads:e,loading:t,activeId:r,onOpen:n,onRemove:i}){return e.length===0?v.jsx("p",{className:"px-2 py-3 text-muted-foreground text-xs",children:t?"Loading…":"Your conversations show up here."}):e.map(s=>v.jsxs("div",{className:`group flex items-center gap-1 rounded-md px-2 py-1.5 text-sm ${s.id===r?"bg-muted":"hover:bg-muted/60"}`,children:[v.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>n(s.id),title:s.title,children:[v.jsx("span",{className:"block truncate",children:s.title}),v.jsxs("span",{className:"block truncate text-muted-foreground text-xs",children:[rS(s.updatedAt),s.model?` · ${s.model}`:"",s.peerId?` · ${Aa(s.peerId)}`:""]})]}),v.jsx("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:text-foreground focus-visible:opacity-100 md:opacity-0 md:group-hover:opacity-100","aria-label":`Delete "${s.title}"`,onClick:()=>i(s.id),children:v.jsx(hO,{className:"size-3.5"})})]},s.id))}function a0e(){var Ae,ze,re,Le,et;const{workspace:e,viewer:t,me:r}=Z9(),n=`${e.id}:${r.member.id}`,i=co({queryKey:tn.chatModels(e.id),queryFn:()=>Ws.chat.models(e.id),staleTime:6e4}),[s,a]=k.useState(()=>Yo(`model:${n}`,null)),[o,l]=k.useState(()=>Yo(`peer:${n}`,null)),u=Y9(),c=co({queryKey:tn.chatThreads(e.id),queryFn:()=>Ws.chat.threads(e.id)}),d=co({queryKey:tn.chatContext(e.id),queryFn:()=>Ws.chat.context(e.id),staleTime:3e4}),h=Qce(),[f,m]=k.useState(()=>Yo(`chat:${n}`,A6())),[b,y]=k.useState(!1),E=((Ae=i.data)==null?void 0:Ae.find(Te=>Te.id===s))??(s?(ze=i.data)==null?void 0:ze.find(Te=>I6(Te.id)===I6(s)):void 0)??null,[w,x]=k.useState(null),_=K9(t),A=X9(e.id,_),S=!!A.data&&Number(A.data.available)<=0,I=((re=d.data)==null?void 0:re.key.id)??null,N=co({queryKey:["chat-route-preview",e.id,I,s],queryFn:()=>Ws.network.routePreview({model:s,key:I}),enabled:!!(s&&I),staleTime:3e4});k.useEffect(()=>{var Ke;if(!((Ke=i.data)!=null&&Ke.length)||E)return;const Te=i.data.find(ot=>ot.toolUse)??i.data[0];s&&x(s),a(Te.id)},[i.data,E]),k.useEffect(()=>{Ko(`model:${n}`,s)},[n,s]),k.useEffect(()=>{Ko(`peer:${n}`,o)},[n,o]),k.useEffect(()=>{Ko(`chat:${n}`,f)},[n,f]);const U=k.useRef({workspaceId:e.id,model:s,peerId:o});U.current={workspaceId:e.id,model:s,peerId:o};const z=k.useMemo(()=>new sp({api:`${Q9}/chat`,credentials:"same-origin",headers:{[J9]:"1"},prepareSendMessagesRequest:({id:Te,messages:Ke})=>({body:{...U.current,id:Te,messages:Ke.slice(-1)}})}),[]),{messages:Z,sendMessage:V,status:ae,stop:J,error:Y,setMessages:de,clearError:xe,addToolApprovalResponse:Ue}=qP({id:f,transport:z,sendAutomaticallyWhen:MP}),He=co({queryKey:tn.chatThread(e.id,f),queryFn:()=>Ws.chat.thread(e.id,f),enabled:(c.data??[]).some(Te=>Te.id===f),staleTime:1/0});k.useEffect(()=>{He.data&&(de(He.data.messages),He.data.model&&a(He.data.model),l(He.data.peerId))},[He.data]),k.useEffect(()=>{(ae==="streaming"||ae==="ready")&&Z.length>0&&u.invalidateQueries({queryKey:tn.chatThreads(e.id)}),ae==="ready"&&Z.length>0&&(u.removeQueries({queryKey:tn.chatThread(e.id,f),exact:!0}),u.invalidateQueries({queryKey:tn.chatContext(e.id)}),u.invalidateQueries({queryKey:["chat-route-preview",e.id]}))},[ae]),k.useEffect(()=>{Y&&(u.invalidateQueries({queryKey:tn.chatModels(e.id)}),u.invalidateQueries({queryKey:["chat-route-preview",e.id]}),_&&u.invalidateQueries({queryKey:tn.wallet(e.id)}))},[Y]);const L=ae==="submitted"||ae==="streaming",Re=Z.reduce((Te,Ke)=>{var Rt;const ot=(Rt=Ke.metadata)==null?void 0:Rt.costUsd;return Te===null||ot===null?null:Te+(ot??0)},0),Q=Te=>{const Ke=Te.text.trim();!Ke||!s||L||(u.setQueryData(tn.chatThreads(e.id),(ot=[])=>ot.some(Rt=>Rt.id===f)?ot:[{id:f,title:Ke.replace(/\s+/g," ").slice(0,80),model:s,peerId:o,createdAt:Date.now(),updatedAt:Date.now()},...ot]),V({text:Ke}))},M=Te=>{y(!1),!(Te===f||L)&&(xe(),de([]),m(Te))},pe=()=>{y(!1),J(),xe(),de([]),m(A6())},oe=eS({mutationFn:Te=>Ws.chat.deleteThread(e.id,Te),onSuccess:(Te,Ke)=>{Ke===f&&pe()},invalidate:[tn.chatThreads(e.id)]}),fe=["What are today's top AI news? Search and cite sources.","Read https://antseed.com and explain how it works in 5 bullets.",yg(t)?"Write a Python script that prints the first 20 primes, save it and run it.":"Write a short README for a CLI tool and save it as README.md."];return v.jsxs("div",{ref:h,className:"gc-chat gc-chat-page flex gap-4",children:[v.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col gap-2 md:flex","aria-label":"Conversations",children:[v.jsxs(Hr,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:pe,disabled:Z.length===0&&!L,children:[v.jsx(od,{className:"size-3.5"})," New chat"]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:v.jsx(R6,{threads:c.data??[],loading:c.isLoading,activeId:f,onOpen:M,onRemove:Te=>oe.mutate(Te)})})]}),v.jsxs(tS,{isOpen:b,onClose:()=>y(!1),side:"left",title:"Chats",className:"gc-chat gc-chat-history",children:[v.jsxs(Hr,{variant:"outline",size:"sm",className:"mb-2 w-full justify-start gap-2",onClick:pe,children:[v.jsx(od,{className:"size-3.5"})," New chat"]}),v.jsx(R6,{threads:c.data??[],loading:c.isLoading,activeId:f,onOpen:M,onRemove:Te=>oe.mutate(Te)})]}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3 max-sm:gap-2",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-2 max-sm:flex-nowrap max-sm:gap-1",children:[v.jsx(Hr,{variant:"ghost",size:"icon-sm",className:"shrink-0 md:hidden",onClick:()=>y(!0),"aria-label":"Chats",children:v.jsx(lO,{className:"size-4"})}),v.jsx("h1",{className:"mr-auto font-semibold text-xl max-sm:sr-only",children:"Chat"}),v.jsx(n0e,{models:i.data??[],value:E,onChange:Te=>{a(Te),l(null),x(null)},className:"max-sm:mx-auto max-sm:min-w-0 max-sm:border-transparent max-sm:bg-transparent max-sm:font-semibold max-sm:shadow-none max-sm:dark:border-transparent max-sm:dark:bg-transparent"}),v.jsx(N6,{model:E,value:o,onChange:l,preview:N.data,previewLoading:N.isLoading,unfunded:S,className:"max-sm:hidden"}),v.jsxs(Hr,{variant:"ghost",size:"sm",className:"shrink-0 md:hidden max-sm:size-8 max-sm:p-0",onClick:pe,disabled:Z.length===0&&!L,"aria-label":"New chat",children:[v.jsx(od,{className:"size-4"})," ",v.jsx("span",{className:"max-sm:sr-only",children:"New"})]})]}),v.jsxs("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:[o&&E?v.jsxs(v.Fragment,{children:["Every turn goes to ",v.jsx("span",{className:"font-medium text-foreground",children:za(E.peers.find(Te=>Te.peerId===o)??{peerId:o,name:null})}),". Each answer shows the peer that served it."]}):v.jsxs(v.Fragment,{children:["The gateway routes each turn to the best offer for ",(E==null?void 0:E.name)??"the model","; each answer shows the seller that served it, and you can pin one to always use it."]})," ","Tools run on the gateway."]}),w&&E&&v.jsx("p",{className:"text-muted-foreground text-xs",children:v.jsxs(qm,{children:["No seller offers ",w," right now (sellers stop offering a model while they are busy), so the chat switched to ",E.name,"."]})}),o&&E&&!E.peers.some(Te=>Te.peerId===o)&&v.jsx("p",{className:"text-muted-foreground text-xs",children:v.jsxs(qm,{children:[Aa(o)," no longer offers ",E.name," (sellers stop offering a model while they are busy)."," ",v.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:()=>l(null),children:"Use Auto"})," or pick another seller."]})}),!o&&v.jsx("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:$9(j5(N.data),E,N.isLoading,S)}),v.jsx("p",{className:"text-muted-foreground text-xs max-sm:hidden",children:v.jsx(Jce,{apiKey:(Le=d.data)==null?void 0:Le.key,workspaceName:((et=d.data)==null?void 0:et.workspaceName)??e.name,chatCost:Re})}),v.jsxs(SD,{className:"gc-chat-conversation rounded-xl border bg-card max-sm:rounded-none max-sm:border-0 max-sm:bg-transparent",children:[v.jsxs(AD,{className:"max-sm:gap-6 max-sm:px-0",children:[Z.length===0?v.jsx(CD,{children:v.jsxs("div",{className:"flex w-full min-w-0 max-w-2xl flex-col items-center gap-2 text-center",children:[v.jsx("h3",{className:"font-medium text-base",children:"Ask anything"}),v.jsx("p",{className:"text-muted-foreground text-sm",children:"The agent can search and read the web and keep files in this chat's scratch space on the gateway."}),v.jsx("div",{className:"mt-3 flex flex-wrap justify-center gap-2",children:fe.map(Te=>v.jsx(Rce,{suggestion:Te,onClick:Ke=>Q({text:Ke}),className:"h-auto min-h-8 max-w-full whitespace-normal py-1.5 max-sm:w-full max-sm:rounded-xl max-sm:text-left"},Te))})]})}):Z.map((Te,Ke)=>{const ot=L&&Ke===Z.length-1;return v.jsxs(mie,{from:Te.role,children:[v.jsx(t0e,{message:Te,streaming:ot,initials:e0e(r.member.label)}),v.jsx(pie,{children:Te.parts.map((Rt,bn)=>{const Jr=`${Te.id}-${bn}`;if(Rt.type==="text")return v.jsx(_w,{children:Rt.text},Jr);if(Rt.type==="reasoning")return v.jsxs(N9,{isStreaming:ot&&bn===Te.parts.length-1,children:[v.jsx(R9,{}),v.jsx(P9,{children:Rt.text})]},Jr);if(Rt.type==="dynamic-tool"||Rt.type.startsWith("tool-")){const $n=!L&&Ke===Z.length-1;return v.jsx(s0e,{part:Rt,onApproval:$n?(_r,en)=>{Ue({id:_r,approved:en})}:null},Jr)}return null})}),Te.role==="assistant"&&v.jsx(r0e,{metadata:Te.metadata})]},Te.id)}),Y&&v.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:/out of AntSeed credits|insufficient_deposits/i.test(Y.message)?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-medium",children:"No free seller took this, and paid ones need funds."})," ","No free seller offers ",(E==null?void 0:E.name)??"this model"," right now (free sellers stop offering a model while they are busy), and the ",e.name," wallet has no deposits for a paid one."," ",v.jsx("a",{className:"font-medium underline underline-offset-2",href:Zm("wallet"),onClick:Wm("wallet"),children:"Add funds"}),", or pick a model marked ",v.jsx(Ar,{tone:"free",children:"Free"}),"."]}):/model_not_found|not served by this peer/i.test(Y.message)?v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"font-medium",children:["The seller stopped offering ",(E==null?void 0:E.name)??"this model","."]})," ","Sellers drop a model while they are busy, and the list had not caught up yet. Send again",o?v.jsxs(v.Fragment,{children:[" after switching to ",v.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:()=>l(null),children:"Auto"})]}):""," to use another seller."]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-medium",children:"The request failed."})," ",Y.message]})})]}),v.jsx(ID,{})]}),v.jsxs(vse,{onSubmit:Q,className:"max-sm:[&_[data-slot=input-group]]:rounded-3xl",children:[v.jsx(xse,{children:v.jsx(Ese,{placeholder:E?`Message ${E.name}…`:"Loading models…",className:"max-sm:min-h-10"})}),v.jsxs(_se,{children:[v.jsxs(Tse,{className:"min-w-0",children:[v.jsx(N6,{model:E,value:o,onChange:l,preview:N.data,previewLoading:N.isLoading,unfunded:S,compact:!0,className:"min-w-0 max-w-[65vw] text-muted-foreground sm:hidden"}),v.jsxs("span",{className:"px-2 text-muted-foreground text-xs max-sm:hidden",children:[E?E.toolUse?"Web search, web pages and scratch files":"This model cannot use tools; plain chat":"",E!=null&&E.toolUse&&yg(t)?", plus a shell that asks before each command (admins)":""]})]}),v.jsx(wse,{status:ae,onStop:J,disabled:!s})]})]})]})]})}const T0e=Object.freeze(Object.defineProperty({__proto__:null,default:a0e},Symbol.toStringTag,{value:"Module"})),o0e=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:vw},Symbol.toStringTag,{value:"Module"}));export{T0e as C,E0e as F,Zt as S,fre as a};